diff --git a/src/views/dashboard/related/topology/Index.vue b/src/views/dashboard/related/topology/Index.vue index c940005f..087e834c 100644 --- a/src/views/dashboard/related/topology/Index.vue +++ b/src/views/dashboard/related/topology/Index.vue @@ -32,7 +32,6 @@ defineProps({ }, }); const dashboardStore = useDashboardStore(); -console.log(dashboardStore.entity); const isSankey = ref( [EntityType[2].value, EntityType[3].value].includes(dashboardStore.entity) ); diff --git a/src/views/dashboard/related/topology/components/Graph.vue b/src/views/dashboard/related/topology/components/Graph.vue index bc93e020..77613db7 100644 --- a/src/views/dashboard/related/topology/components/Graph.vue +++ b/src/views/dashboard/related/topology/components/Graph.vue @@ -95,8 +95,8 @@ const { t } = useI18n(); const selectorStore = useSelectorStore(); const topologyStore = useTopologyStore(); const dashboardStore = useDashboardStore(); -const height = ref(document.body.clientHeight); -const width = ref(document.body.clientWidth); +const height = ref(0); +const width = ref(0); const loading = ref(false); const simulation = ref(null); const svg = ref>(null); @@ -128,7 +128,7 @@ onMounted(async () => { ElMessage.error(resp.errors); } const dom = document.querySelector(".topology")?.getBoundingClientRect() || { - height: 0, + height: 40, width: 0, }; height.value = dom.height - 40; diff --git a/src/views/dashboard/related/topology/components/PodTopology.vue b/src/views/dashboard/related/topology/components/PodTopology.vue index 30be3dcf..4b791a06 100644 --- a/src/views/dashboard/related/topology/components/PodTopology.vue +++ b/src/views/dashboard/related/topology/components/PodTopology.vue @@ -96,8 +96,8 @@ const dashboardStore = useDashboardStore(); const selectorStore = useSelectorStore(); const topologyStore = useTopologyStore(); const loading = ref(false); -const height = ref(document.body.clientHeight); -const width = ref(document.body.clientWidth); +const height = ref(0); +const width = ref(0); const showSettings = ref(false); const settings = ref({}); const operationsPos = reactive<{ x: number; y: number }>({ x: NaN, y: NaN }); @@ -120,11 +120,11 @@ async function loadTopology(id: string) { ElMessage.error(resp.errors); } const dom = document.querySelector(".topology")?.getBoundingClientRect() || { - height: 0, - width: 0, + height: 70, + width: 5, }; - height.value = dom.height - 40; - width.value = dom.width; + height.value = dom.height - 70; + width.value = dom.width - 5; } function inspect() {