From fe28289bc0003b30fc29beb0bf5cbb3c719a48f6 Mon Sep 17 00:00:00 2001 From: Fine Date: Fri, 9 Jun 2023 16:00:06 +0800 Subject: [PATCH] fix: remove unused code --- src/store/modules/task-timeline.ts | 62 ------------------- .../task-timeline/components/Timeline.vue | 6 +- 2 files changed, 3 insertions(+), 65 deletions(-) diff --git a/src/store/modules/task-timeline.ts b/src/store/modules/task-timeline.ts index 60f2c426..09bbc1ed 100644 --- a/src/store/modules/task-timeline.ts +++ b/src/store/modules/task-timeline.ts @@ -62,15 +62,6 @@ export const taskTimelineStore = defineStore({ return res.data; } this.taskList = res.data.data.queryEBPFTasks || []; - if (!this.taskList.length) { - const networkProfilingStore = useNetworkProfilingStore(); - networkProfilingStore.seNodes([]); - networkProfilingStore.setLinks([]); - this.eBPFSchedules = []; - this.analyzeTrees = []; - this.selectedTask = {}; - return; - } // this.selectedTask = this.taskList[0] || {}; // await this.getGraphData(); return res.data; @@ -116,59 +107,6 @@ export const taskTimelineStore = defineStore({ } return resp; }, - - async getEBPFSchedules(params: { taskId: string }) { - if (!params.taskId) { - return new Promise((resolve) => resolve({})); - } - // params.taskId = "71d96efb81b0be93b1322be1b17334c87d45d6216e299504a778264f94692d1b"; - const res: AxiosResponse = await graphql.query("getEBPFSchedules").params({ ...params }); - - if (res.data.errors) { - this.eBPFSchedules = []; - return res.data; - } - this.ebpftTips = ""; - const { eBPFSchedules } = res.data.data; - - this.eBPFSchedules = eBPFSchedules; - if (!eBPFSchedules.length) { - this.eBPFSchedules = []; - this.analyzeTrees = []; - } - return res.data; - }, - async getEBPFAnalyze(params: { - scheduleIdList: string[]; - timeRanges: Array<{ start: number; end: number }>; - aggregateType: string; - }) { - this.aggregateType = params.aggregateType; - if (!params.scheduleIdList.length) { - return new Promise((resolve) => resolve({})); - } - if (!params.timeRanges.length) { - return new Promise((resolve) => resolve({})); - } - const res: AxiosResponse = await graphql.query("getEBPFResult").params(params); - - if (res.data.errors) { - this.analyzeTrees = []; - return res.data; - } - const { analysisEBPFResult } = res.data.data; - this.ebpftTips = analysisEBPFResult.tip; - if (!analysisEBPFResult) { - this.analyzeTrees = []; - return res.data; - } - if (analysisEBPFResult.tip) { - this.analyzeTrees = []; - return res.data; - } - this.analyzeTrees = analysisEBPFResult.trees; - return res.data; - }, async preAnalyzeTask() { if (this.selectedStrategy.type === "NETWORK") { const networkProfilingStore = useNetworkProfilingStore(); diff --git a/src/views/dashboard/related/task-timeline/components/Timeline.vue b/src/views/dashboard/related/task-timeline/components/Timeline.vue index 581423a7..fb1cf904 100644 --- a/src/views/dashboard/related/task-timeline/components/Timeline.vue +++ b/src/views/dashboard/related/task-timeline/components/Timeline.vue @@ -82,7 +82,7 @@ limitations under the License. --> const taskList = taskTimelineStore.taskList.map((d: EBPFTaskList, index: number) => { return { id: index + 1, - // content: d.triggerType, + // content: d.targetType, start: new Date(Number(d.taskStartTime)), end: new Date(Number(d.taskStartTime + d.fixedTriggerDuration * 1000)), data: d, @@ -107,8 +107,8 @@ limitations under the License. -->
Service Name: ${data.serviceName || ""}
Service Instance Name: ${data.serviceInstanceName || ""}
Service Process Name: ${data.processName || ""}
-
Trigger Type: ${data.triggerType || ""}
Target Type: ${data.targetType || ""}
+
Trigger Type: ${data.triggerType || ""}
Start Time: ${data.taskStartTime ? visDate(data.taskStartTime) : ""}
End Time: ${end}
Process Labels: ${data.processLabels.join("; ") || ""}
`; @@ -150,7 +150,7 @@ limitations under the License. --> } } watch( - () => selectorStore.currentPod, + () => selectorStore.currentProcess, () => { init(); },