This commit is contained in:
Fine 2022-08-22 14:58:13 +08:00
parent 447936e0bb
commit eb58ff1d62
3 changed files with 17 additions and 5 deletions

View File

@ -113,7 +113,7 @@ export const networkProfilingStore = defineStore({
if (res.data.errors) {
return res.data;
}
this.getTaskList({
await this.getTaskList({
...param,
targets: ["NETWORK"],
});

View File

@ -15,17 +15,20 @@ limitations under the License. -->
<template>
<div class="flex-h content">
<Tasks />
<div class="vis-graph ml-5" v-show="networkProfilingStore.nodes.length">
<div class="vis-graph ml-5" v-if="networkProfilingStore.nodes.length">
<process-topology />
</div>
<div class="text" v-else>{{ t("noData") }}</div>
</div>
</template>
<script lang="ts" setup>
import { useI18n } from "vue-i18n";
import Tasks from "./components/Tasks.vue";
import ProcessTopology from "./components/ProcessTopology.vue";
import { useNetworkProfilingStore } from "@/store/modules/network-profiling";
const networkProfilingStore = useNetworkProfilingStore();
const { t } = useI18n();
</script>
<style lang="scss" scoped>
.content {
@ -41,4 +44,10 @@ const networkProfilingStore = useNetworkProfilingStore();
position: relative;
width: calc(100% - 300px);
}
.text {
width: calc(100% - 300px);
text-align: center;
margin-top: 30px;
}
</style>

View File

@ -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();
}
</script>
<style lang="scss" scoped>