feat: remove the total filed from query conditions (#93)

This commit is contained in:
Fine0830
2022-05-19 15:49:24 +08:00
committed by GitHub
parent 7e0d716111
commit b953904c71
11 changed files with 67 additions and 43 deletions

View File

@@ -31,7 +31,6 @@ interface LogState {
selectorStore: any;
supportQueryLogsByKeywords: boolean;
logs: any[];
logsTotal: number;
loadLogs: boolean;
}
@@ -43,12 +42,11 @@ export const logStore = defineStore({
endpoints: [{ value: "0", label: "All" }],
conditions: {
queryDuration: useAppStoreWithOut().durationTime,
paging: { pageNum: 1, pageSize: 15, needTotal: true },
paging: { pageNum: 1, pageSize: 15 },
},
supportQueryLogsByKeywords: true,
selectorStore: useSelectorStore(),
logs: [],
logsTotal: 0,
loadLogs: false,
}),
actions: {
@@ -131,7 +129,6 @@ export const logStore = defineStore({
}
this.logs = res.data.data.queryLogs.logs;
this.logsTotal = res.data.data.queryLogs.total;
return res.data;
},
async getBrowserLogs() {
@@ -145,7 +142,6 @@ export const logStore = defineStore({
return res.data;
}
this.logs = res.data.data.queryBrowserErrorLogs.logs;
this.logsTotal = res.data.data.queryBrowserErrorLogs.total;
return res.data;
},
async getLogTagKeys() {

View File

@@ -28,12 +28,10 @@ interface TraceState {
instances: Instance[];
endpoints: Endpoint[];
traceList: Trace[];
traceTotal: number;
traceSpans: Span[];
currentTrace: Trace | any;
conditions: any;
traceSpanLogs: any[];
traceSpanLogsTotal: number;
selectorStore: any;
}
@@ -45,16 +43,14 @@ export const traceStore = defineStore({
endpoints: [{ value: "0", label: "All" }],
traceList: [],
traceSpans: [],
traceTotal: 0,
currentTrace: {},
conditions: {
queryDuration: useAppStoreWithOut().durationTime,
traceState: "ALL",
queryOrder: "BY_START_TIME",
paging: { pageNum: 1, pageSize: 15, needTotal: true },
paging: { pageNum: 1, pageSize: 20 },
},
traceSpanLogs: [],
traceSpanLogsTotal: 0,
selectorStore: useSelectorStore(),
}),
actions: {
@@ -115,7 +111,6 @@ export const traceStore = defineStore({
return res.data;
}
if (!res.data.data.data.traces.length) {
this.traceTotal = 0;
this.traceList = [];
this.setCurrentTrace({});
this.setTraceSpans([]);
@@ -128,7 +123,6 @@ export const traceStore = defineStore({
});
return d;
});
this.traceTotal = res.data.data.data.total;
this.setCurrentTrace(res.data.data.data.traces[0] || {});
return res.data;
},
@@ -148,11 +142,9 @@ export const traceStore = defineStore({
.params(params);
if (res.data.errors) {
this.traceSpanLogs = [];
this.traceSpanLogsTotal = 0;
return res.data;
}
this.traceSpanLogs = res.data.data.queryLogs.logs || [];
this.traceSpanLogsTotal = res.data.data.queryLogs.total;
return res.data;
},
async getTagKeys() {