From b2cbc4f9f887b628d613d4a71b79b2fc9ec99863 Mon Sep 17 00:00:00 2001 From: Fine Date: Thu, 1 Jun 2023 15:00:08 +0800 Subject: [PATCH] fix: selectors --- .../components/GraphPanel.vue | 63 +++++++++++-------- .../components/ProcessTopology.vue | 6 +- 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/views/dashboard/related/continuous-profiling/components/GraphPanel.vue b/src/views/dashboard/related/continuous-profiling/components/GraphPanel.vue index 582b9c66..352e77bc 100644 --- a/src/views/dashboard/related/continuous-profiling/components/GraphPanel.vue +++ b/src/views/dashboard/related/continuous-profiling/components/GraphPanel.vue @@ -20,7 +20,7 @@ limitations under the License. --> - -
+
@@ -49,7 +46,7 @@ limitations under the License. --> {{ t("noData") }}
-
+
@@ -71,8 +68,9 @@ limitations under the License. --> import EBPFSchedules from "@/views/dashboard/related/ebpf/components/EBPFSchedules.vue"; import EBPFStack from "@/views/dashboard/related/ebpf/components/EBPFStack.vue"; import { TargetTypes, ComponentType } from "../data"; + import type { Instance, Process } from "@/types/selector"; - /*global defineProps */ + /*global defineProps, Recordable */ defineProps({ config: { type: Object as PropType, @@ -83,24 +81,25 @@ limitations under the License. --> const networkProfilingStore = useNetworkProfilingStore(); const selectorStore = useSelectorStore(); const { t } = useI18n(); - const processId = ref(""); - const instanceId = ref(""); + const process = ref>({}); + const instance = ref>({}); - function changeInstance(opt: { id: string }[]) { - instanceId.value = opt[0].id; + function changeInstance(opt: Recordable[]) { + instance.value = opt[0]; + continousProfilingStore.setCurrentInstance(instance.value); } - function changeProcess(opt: { id: string }[]) { - processId.value = opt[0].id; + function changeProcess(opt: Recordable[]) { + process.value = opt[0]; } async function getSelectors() { const serviceId = (selectorStore.currentService && selectorStore.currentService.id) || ""; await continousProfilingStore.getServiceInstances(serviceId); - instanceId.value = (continousProfilingStore.instances[0] || {}).id || ""; - await continousProfilingStore.getProcesses(instanceId.value); - processId.value = (continousProfilingStore.processes[0] || {}).id || ""; + instance.value = continousProfilingStore.instances[0] || {}; + await continousProfilingStore.getProcesses(instance.value.id); + process.value = continousProfilingStore.processes[0] || {}; } getSelectors(); @@ -125,24 +124,34 @@ limitations under the License. --> } .vis-graph { - height: 100%; - flex-grow: 2; - min-width: 700px; - overflow: auto; - } - - .vis-graph-topology { height: calc(100% - 20px); flex-grow: 2; min-width: 700px; + overflow: auto; + width: 100%; + } + + .graph-topology, + .graph-flame { + height: 100%; overflow: hidden; position: relative; - width: calc(100% - 330px); + width: calc(100% - 5px); + } + + .graph-flame { + overflow: auto; } .policy-graph { - height: calc(100% - 20px); + height: 100%; flex-grow: 2; overflow: auto; } + + .text { + height: 100%; + text-align: center; + margin-top: 100px; + } diff --git a/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue b/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue index e1680daf..427cb923 100644 --- a/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue +++ b/src/views/dashboard/related/network-profiling/components/ProcessTopology.vue @@ -19,7 +19,7 @@ limitations under the License. --> - {{ selectorStore.currentPod.label }} + {{ selectorStore.currentPod && selectorStore.currentPod.label }} @@ -530,11 +530,11 @@ limitations under the License. --> border-radius: 3px; position: absolute; top: 10px; - right: 10px; + right: 20px; } .range { - right: 50px; + right: 60px; } .topo-call {