diff --git a/src/store/modules/task-timeline.ts b/src/store/modules/task-timeline.ts index 4eeac27d..c7b68715 100644 --- a/src/store/modules/task-timeline.ts +++ b/src/store/modules/task-timeline.ts @@ -22,9 +22,11 @@ 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 { useEbpfStore } from "@/store/modules/ebpf"; import dateFormatStep from "@/utils/dateFormat"; import getLocalTime from "@/utils/localtime"; - +import { TargetTypes } from "@/views/dashboard/related/continuous-profiling/data"; interface taskTimelineState { loading: boolean; taskList: EBPFTaskList[]; @@ -74,6 +76,23 @@ export const taskTimelineStore = defineStore({ // await this.getGraphData(); return res.data; }, + async getGraphData() { + let res: any = {}; + const continousProfilingStore = useContinousProfilingStore(); + + if (continousProfilingStore.selectedStrategy.type === TargetTypes[2].value) { + res = await this.getTopology(); + } else { + const ebpfStore = useEbpfStore(); + res = await ebpfStore.getEBPFSchedules({ + taskId: this.selectedTask.taskId, + }); + } + + if (res.errors) { + ElMessage.error(res.errors); + } + }, async getTopology() { const networkProfilingStore = useNetworkProfilingStore(); const appStore = useAppStoreWithOut(); diff --git a/src/views/dashboard/related/task-timeline/components/ProfilingPanel.vue b/src/views/dashboard/related/task-timeline/components/ProfilingPanel.vue index 4db1beb0..59e2ecd6 100644 --- a/src/views/dashboard/related/task-timeline/components/ProfilingPanel.vue +++ b/src/views/dashboard/related/task-timeline/components/ProfilingPanel.vue @@ -19,7 +19,14 @@ limitations under the License. --> {{ t("noData") }} -