mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-03 23:05:24 +00:00
fix: types
This commit is contained in:
parent
59bfce472d
commit
bdd4353b0a
@ -262,7 +262,7 @@ export function useQueryPodsMetrics(
|
||||
|
||||
export function usePodsSource(
|
||||
pods: Array<Instance | Endpoint>,
|
||||
resp: { errors: string; data: { [key: string]: any } },
|
||||
resp: { errors: string; data: Recordable },
|
||||
config: {
|
||||
metrics: string[];
|
||||
metricTypes: string[];
|
||||
|
@ -85,9 +85,11 @@ limitations under the License. -->
|
||||
|
||||
function getPathNames() {
|
||||
const p = route.params;
|
||||
// get names
|
||||
|
||||
// set names
|
||||
if (appStore.pathNames.length && p.layerId === appStore.pathNames[0].layerId) {
|
||||
const arr = [...appStore.pathNames, p];
|
||||
|
||||
const list = deduplication(arr, ["layerId", "entity", "name"]);
|
||||
appStore.setPathNames(list);
|
||||
} else {
|
||||
|
@ -27,7 +27,7 @@ interface DemandLogState {
|
||||
containers: Instance[];
|
||||
instances: Instance[];
|
||||
conditions: Conditions;
|
||||
selectorStore: any;
|
||||
selectorStore: Recordable;
|
||||
logs: Log[];
|
||||
loadLogs: boolean;
|
||||
message: string;
|
||||
|
@ -27,10 +27,10 @@ interface LogState {
|
||||
services: Service[];
|
||||
instances: Instance[];
|
||||
endpoints: Endpoint[];
|
||||
conditions: any;
|
||||
selectorStore: any;
|
||||
conditions: Recordable;
|
||||
selectorStore: Recordable;
|
||||
supportQueryLogsByKeywords: boolean;
|
||||
logs: any[];
|
||||
logs: Recordable[];
|
||||
loadLogs: boolean;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ export const logStore = defineStore({
|
||||
loadLogs: false,
|
||||
}),
|
||||
actions: {
|
||||
setLogCondition(data: any) {
|
||||
setLogCondition(data: Recordable) {
|
||||
this.conditions = { ...this.conditions, ...data };
|
||||
},
|
||||
resetState() {
|
||||
@ -152,6 +152,6 @@ export const logStore = defineStore({
|
||||
},
|
||||
});
|
||||
|
||||
export function useLogStore(): any {
|
||||
export function useLogStore(): Recordable {
|
||||
return logStore(store);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ export const networkProfilingStore = defineStore({
|
||||
this.activeMetricIndex = index;
|
||||
},
|
||||
setTopology(data: { nodes: ProcessNode[]; calls: Call[] }) {
|
||||
const obj = {} as any;
|
||||
const obj = {} as Recordable;
|
||||
let calls = (data.calls || []).reduce((prev: Call[], next: Call) => {
|
||||
if (!obj[next.id]) {
|
||||
obj[next.id] = true;
|
||||
@ -92,7 +92,7 @@ export const networkProfilingStore = defineStore({
|
||||
}
|
||||
return prev;
|
||||
}, []);
|
||||
const param = {} as any;
|
||||
const param = {} as Recordable;
|
||||
calls = data.calls.reduce((prev: (Call | any)[], next: Call | any) => {
|
||||
if (param[next.targetId + next.sourceId]) {
|
||||
next.lowerArc = true;
|
||||
@ -182,6 +182,6 @@ export const networkProfilingStore = defineStore({
|
||||
},
|
||||
});
|
||||
|
||||
export function useNetworkProfilingStore(): any {
|
||||
export function useNetworkProfilingStore(): Recordable {
|
||||
return networkProfilingStore(store);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ export const topologyStore = defineStore({
|
||||
this.nodes = data.nodes;
|
||||
},
|
||||
setTopology(data: { nodes: Node[]; calls: Call[] }) {
|
||||
const obj = {} as any;
|
||||
const obj = {} as Recordable;
|
||||
const services = useSelectorStore().services;
|
||||
const nodes = (data.nodes || []).reduce((prev: Node[], next: Node) => {
|
||||
if (!obj[next.id]) {
|
||||
|
@ -31,9 +31,9 @@ interface TraceState {
|
||||
traceList: Trace[];
|
||||
traceSpans: Span[];
|
||||
currentTrace: Recordable<Trace>;
|
||||
conditions: any;
|
||||
traceSpanLogs: any[];
|
||||
selectorStore: any;
|
||||
conditions: Recordable;
|
||||
traceSpanLogs: Recordable[];
|
||||
selectorStore: Recordable;
|
||||
}
|
||||
|
||||
export const traceStore = defineStore({
|
||||
@ -55,7 +55,7 @@ export const traceStore = defineStore({
|
||||
selectorStore: useSelectorStore(),
|
||||
}),
|
||||
actions: {
|
||||
setTraceCondition(data: any) {
|
||||
setTraceCondition(data: Recordable) {
|
||||
this.conditions = { ...this.conditions, ...data };
|
||||
},
|
||||
setCurrentTrace(trace: Recordable<Trace>) {
|
||||
@ -171,7 +171,7 @@ export const traceStore = defineStore({
|
||||
this.setTraceSpans(data || []);
|
||||
return res.data;
|
||||
},
|
||||
async getSpanLogs(params: any) {
|
||||
async getSpanLogs(params: Recordable) {
|
||||
const res: AxiosResponse = await graphql.query("queryServiceLogs").params(params);
|
||||
if (res.data.errors) {
|
||||
this.traceSpanLogs = [];
|
||||
@ -197,6 +197,6 @@ export const traceStore = defineStore({
|
||||
},
|
||||
});
|
||||
|
||||
export function useTraceStore(): any {
|
||||
export function useTraceStore() {
|
||||
return traceStore(store);
|
||||
}
|
||||
|
2
src/types/app.d.ts
vendored
2
src/types/app.d.ts
vendored
@ -44,6 +44,6 @@ export type EventParams = {
|
||||
dataType: string;
|
||||
value: number | Array;
|
||||
color: string;
|
||||
event: any;
|
||||
event: Record<string, T>;
|
||||
dataIndex: number;
|
||||
};
|
||||
|
4
src/types/profile.d.ts
vendored
4
src/types/profile.d.ts
vendored
@ -55,8 +55,8 @@ export interface SegmentSpan {
|
||||
component: string;
|
||||
isError: boolean;
|
||||
layer: string;
|
||||
tags: any[];
|
||||
logs: any[];
|
||||
tags: Recordable[];
|
||||
logs: Recordable[];
|
||||
}
|
||||
|
||||
export interface ProfileTaskCreationRequest {
|
||||
|
@ -71,7 +71,7 @@ limitations under the License. -->
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
|
||||
/*global defineEmits, defineProps */
|
||||
/*global defineEmits, defineProps, Recordable */
|
||||
const emit = defineEmits(["update"]);
|
||||
const props = defineProps({
|
||||
type: { type: String, default: "TRACE" },
|
||||
@ -118,7 +118,7 @@ limitations under the License. -->
|
||||
emit("update", { tagsMap, tagsList: tagsList.value });
|
||||
}
|
||||
async function fetchTagKeys() {
|
||||
let resp: any = {};
|
||||
let resp: Recordable = {};
|
||||
if (props.type === "TRACE") {
|
||||
resp = await traceStore.getTagKeys();
|
||||
} else {
|
||||
@ -137,7 +137,7 @@ limitations under the License. -->
|
||||
|
||||
async function fetchTagValues() {
|
||||
const param = tags.value.split("=")[0];
|
||||
let resp: any = {};
|
||||
let resp: Recordable = {};
|
||||
if (props.type === "TRACE") {
|
||||
resp = await traceStore.getTagValues(param);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user