diff --git a/src/hooks/useExpressionsProcessor.ts b/src/hooks/useExpressionsProcessor.ts index 94ca8378..667c2e2e 100644 --- a/src/hooks/useExpressionsProcessor.ts +++ b/src/hooks/useExpressionsProcessor.ts @@ -129,7 +129,7 @@ export async function useExpressionsQueryProcessor(config: Indexable) { } } if (type === ExpressionResultType.SINGLE_VALUE) { - source[c.label || name] = results[0].values[0].value; + source[c.label || name] = (results[0].values[0] || {}).value; } if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) { source[name] = results[0].values; @@ -259,7 +259,7 @@ export async function useExpressionsQueryPodsMetrics( if (subValues) { d[name]["values"] = subValues; } - d[name]["avg"] = results[i].values[0].value; + d[name]["avg"] = (results[i].values[0] || {}).value; const j = names.find((d: string) => d === name); @@ -278,7 +278,7 @@ export async function useExpressionsQueryPodsMetrics( if (!d[name]) { d[name] = {}; } - d[name]["avg"] = [results[0].values[0].value]; + d[name]["avg"] = [(results[0].values[0] || {}).value]; if (subResults[0]) { if (!d[subName]) { d[subName] = {}; diff --git a/src/store/modules/task-timeline.ts b/src/store/modules/task-timeline.ts index c7b68715..60f2c426 100644 --- a/src/store/modules/task-timeline.ts +++ b/src/store/modules/task-timeline.ts @@ -22,7 +22,7 @@ import type { AxiosResponse } from "axios"; import { useAppStoreWithOut } from "@/store/modules/app"; import type { EBPFTaskList } from "@/types/ebpf"; import { useNetworkProfilingStore } from "@/store/modules/network-profiling"; -import { useContinousProfilingStore } from "@/store/modules/continous-profiling"; +import { useSelectorStore } from "@/store/modules/selectors"; import { useEbpfStore } from "@/store/modules/ebpf"; import dateFormatStep from "@/utils/dateFormat"; import getLocalTime from "@/utils/localtime"; @@ -72,15 +72,13 @@ export const taskTimelineStore = defineStore({ return; } // this.selectedTask = this.taskList[0] || {}; - // this.setselectedTask(this.selectedTask); // await this.getGraphData(); return res.data; }, async getGraphData() { let res: any = {}; - const continousProfilingStore = useContinousProfilingStore(); - if (continousProfilingStore.selectedStrategy.type === TargetTypes[2].value) { + if (this.selectedTask.targetType === TargetTypes[2].value) { res = await this.getTopology(); } else { const ebpfStore = useEbpfStore(); @@ -96,6 +94,7 @@ export const taskTimelineStore = defineStore({ async getTopology() { const networkProfilingStore = useNetworkProfilingStore(); const appStore = useAppStoreWithOut(); + const selectorStore = useSelectorStore(); networkProfilingStore.setSelectedNetworkTask(this.selectedTask); const { taskStartTime, fixedTriggerDuration } = this.selectedTask; const startTime = @@ -105,7 +104,7 @@ export const taskTimelineStore = defineStore({ endTime = new Date().getTime(); } const resp = await networkProfilingStore.getProcessTopology({ - serviceInstanceId: this.instance.id || "", + serviceInstanceId: (selectorStore.currentPod || {}).id || "", duration: { start: dateFormatStep(getLocalTime(appStore.utc, new Date(startTime)), appStore.duration.step, true), end: dateFormatStep(getLocalTime(appStore.utc, new Date(endTime)), appStore.duration.step, true), diff --git a/src/views/dashboard/related/continuous-profiling/components/TaskList.vue b/src/views/dashboard/related/continuous-profiling/components/TaskList.vue deleted file mode 100644 index 39fb17ec..00000000 --- a/src/views/dashboard/related/continuous-profiling/components/TaskList.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - - diff --git a/src/views/dashboard/related/task-timeline/Content.vue b/src/views/dashboard/related/task-timeline/Content.vue index c5b608b3..bd44dd8c 100644 --- a/src/views/dashboard/related/task-timeline/Content.vue +++ b/src/views/dashboard/related/task-timeline/Content.vue @@ -15,7 +15,7 @@ limitations under the License. -->