diff --git a/src/store/modules/network-profiling.ts b/src/store/modules/network-profiling.ts index 9cd7782d..9c70a591 100644 --- a/src/store/modules/network-profiling.ts +++ b/src/store/modules/network-profiling.ts @@ -113,7 +113,7 @@ export const networkProfilingStore = defineStore({ if (res.data.errors) { return res.data; } - this.getTaskList({ + await this.getTaskList({ ...param, targets: ["NETWORK"], }); diff --git a/src/views/dashboard/related/network-profiling/Content.vue b/src/views/dashboard/related/network-profiling/Content.vue index 3493d2d5..78ac3612 100644 --- a/src/views/dashboard/related/network-profiling/Content.vue +++ b/src/views/dashboard/related/network-profiling/Content.vue @@ -15,17 +15,20 @@ limitations under the License. --> diff --git a/src/views/dashboard/related/network-profiling/components/Tasks.vue b/src/views/dashboard/related/network-profiling/components/Tasks.vue index b39fa3e9..4d21c7a5 100644 --- a/src/views/dashboard/related/network-profiling/components/Tasks.vue +++ b/src/views/dashboard/related/network-profiling/components/Tasks.vue @@ -133,7 +133,6 @@ async function getTopology() { fixedTriggerDuration > 1800 ? taskStartTime + fixedTriggerDuration * 1000 - 30 * 60 * 1000 : taskStartTime; - const resp = await networkProfilingStore.getProcessTopology({ serviceInstanceId, duration: { @@ -169,10 +168,14 @@ async function createTask() { if (!serviceInstanceId) { return; } - networkProfilingStore.createNetworkTask({ + const res = await networkProfilingStore.createNetworkTask({ serviceId, serviceInstanceId, }); + if (res.errors) { + ElMessage.error(res.errors); + } + await getTopology(); } function enableInterval() { enableTasks.value = !enableTasks.value; @@ -202,7 +205,7 @@ async function fetchTasks() { enableTasks.value = false; return intervalFn.value && clearInterval(intervalFn.value); } - getTopology(); + await getTopology(); }