From 6fc0c89239b0d1d9ed34292c72381e52985cc2ff Mon Sep 17 00:00:00 2001 From: Fine Date: Tue, 26 Nov 2024 11:34:36 +0800 Subject: [PATCH] update --- src/store/modules/async-profiling.ts | 7 +++---- .../dashboard/related/async-profiling/Content.vue | 6 ++++-- .../dashboard/related/async-profiling/Header.vue | 3 ++- .../related/async-profiling/components/Filter.vue | 11 ++++++----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/store/modules/async-profiling.ts b/src/store/modules/async-profiling.ts index 1ecfeecc..d4dd4771 100644 --- a/src/store/modules/async-profiling.ts +++ b/src/store/modules/async-profiling.ts @@ -82,13 +82,12 @@ export const asyncProfilingStore = defineStore({ this.taskProgress = res.data.data.taskProgress; return res.data; }, - async getServiceInstances(param?: { serviceId: string; isRelation: boolean }): Promise> { - const serviceId = param ? param.serviceId : this.currentService?.id; - if (!serviceId) { + async getServiceInstances(param: { serviceId: string; isRelation: boolean }): Promise> { + if (!param.serviceId) { return null; } const res: AxiosResponse = await graphql.query("queryInstances").params({ - serviceId, + serviceId: param.serviceId, duration: useAppStoreWithOut().durationTime, }); if (!res.data.errors) { diff --git a/src/views/dashboard/related/async-profiling/Content.vue b/src/views/dashboard/related/async-profiling/Content.vue index a93f5edc..53676b58 100644 --- a/src/views/dashboard/related/async-profiling/Content.vue +++ b/src/views/dashboard/related/async-profiling/Content.vue @@ -29,16 +29,18 @@ limitations under the License. --> import { onMounted } from "vue"; import { ElMessage } from "element-plus"; import { useAsyncProfilingStore } from "@/store/modules/async-profiling"; + import { useSelectorStore } from "@/store/modules/selectors"; import TaskList from "./components/TaskList.vue"; import Filter from "./components/Filter.vue"; import EBPFStack from "@/views/dashboard/related/ebpf/components/EBPFStack.vue"; import { ComponentType } from "@/views/dashboard/related/ebpf/components/data"; const asyncProfilingStore = useAsyncProfilingStore(); + const selectorStore = useSelectorStore(); onMounted(async () => { - const resp = await asyncProfilingStore.getServiceInstances(); - if (resp.errors) { + const resp = await asyncProfilingStore.getServiceInstances({ serviceId: selectorStore.currentService.id }); + if (resp && resp.errors) { ElMessage.error(resp.errors); } }); diff --git a/src/views/dashboard/related/async-profiling/Header.vue b/src/views/dashboard/related/async-profiling/Header.vue index abf7fa5f..36242399 100644 --- a/src/views/dashboard/related/async-profiling/Header.vue +++ b/src/views/dashboard/related/async-profiling/Header.vue @@ -19,6 +19,7 @@ limitations under the License. --> style="width: 240px" placeholder="Please input create time to search" @change="searchTasks()" + size="small" > - + {{ t("newTask") }} diff --git a/src/views/dashboard/related/async-profiling/components/Filter.vue b/src/views/dashboard/related/async-profiling/components/Filter.vue index 397bd528..e4b27a53 100644 --- a/src/views/dashboard/related/async-profiling/components/Filter.vue +++ b/src/views/dashboard/related/async-profiling/components/Filter.vue @@ -15,7 +15,7 @@ limitations under the License. -->