fix: set configurations for process topology (#150)

This commit is contained in:
Fine0830 2022-08-29 17:32:49 +08:00 committed by GitHub
parent 1a989a1434
commit d8889f1787
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -30,7 +30,7 @@ limitations under the License. -->
<span>{{ t("delete") }}</span> <span>{{ t("delete") }}</span>
</div> </div>
</el-popover> </el-popover>
<Content /> <Content :config="props.data" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View File

@ -20,7 +20,7 @@ limitations under the License. -->
v-if="networkProfilingStore.nodes.length" v-if="networkProfilingStore.nodes.length"
v-loading="networkProfilingStore.loadNodes" v-loading="networkProfilingStore.loadNodes"
> >
<process-topology /> <process-topology :config="config" />
</div> </div>
<div class="text" v-else v-loading="networkProfilingStore.loadNodes"> <div class="text" v-else v-loading="networkProfilingStore.loadNodes">
{{ t("noData") }} {{ t("noData") }}
@ -28,11 +28,19 @@ limitations under the License. -->
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { PropType } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import Tasks from "./components/Tasks.vue"; import Tasks from "./components/Tasks.vue";
import ProcessTopology from "./components/ProcessTopology.vue"; import ProcessTopology from "./components/ProcessTopology.vue";
import { useNetworkProfilingStore } from "@/store/modules/network-profiling"; import { useNetworkProfilingStore } from "@/store/modules/network-profiling";
/*global defineProps */
defineProps({
config: {
type: Object as PropType<any>,
default: () => ({ graph: {} }),
},
});
const networkProfilingStore = useNetworkProfilingStore(); const networkProfilingStore = useNetworkProfilingStore();
const { t } = useI18n(); const { t } = useI18n();
</script> </script>

View File

@ -15,7 +15,7 @@ limitations under the License. -->
<template> <template>
<div class="label">{{ t("linkDashboard") }}</div> <div class="label">{{ t("linkDashboard") }}</div>
<Selector <Selector
:value="linkDashboard" :value="dashboardStore.selectedGrid.linkDashboard || ''"
:options="linkDashboards" :options="linkDashboards"
size="small" size="small"
placeholder="Please input a dashboard name for calls" placeholder="Please input a dashboard name for calls"
@ -37,8 +37,6 @@ const dashboardStore = useDashboardStore();
const linkDashboards = ref< const linkDashboards = ref<
(DashboardItem & { label: string; value: string })[] (DashboardItem & { label: string; value: string })[]
>([]); >([]);
const { selectedGrid } = dashboardStore;
const linkDashboard = ref<string>(selectedGrid.linkDashboard || "");
onMounted(() => { onMounted(() => {
getDashboards(); getDashboards();
@ -64,7 +62,6 @@ function getDashboards() {
} }
function changeLinkDashboard(opt: { value: string }[]) { function changeLinkDashboard(opt: { value: string }[]) {
linkDashboard.value = opt[0].value;
const p = { const p = {
...dashboardStore.selectedGrid, ...dashboardStore.selectedGrid,
linkDashboard: opt[0].value, linkDashboard: opt[0].value,