diff --git a/src/hooks/useProcessor.ts b/src/hooks/useProcessor.ts index a5b3f486..dea25185 100644 --- a/src/hooks/useProcessor.ts +++ b/src/hooks/useProcessor.ts @@ -46,6 +46,7 @@ export function useQueryProcessor(config: any) { "ServiceRelation", "ServiceInstanceRelation", "EndpointRelation", + "ProcessRelation", ].includes(dashboardStore.entity); if (isRelation && !selectorStore.currentDestService) { return; @@ -93,28 +94,40 @@ export function useQueryProcessor(config: any) { dashboardStore.entity === "All" ? undefined : selectorStore.currentService.normal, - serviceInstanceName: dashboardStore.entity.includes("ServiceInstance") + serviceInstanceName: [ + "ServiceInstance", + "ServiceInstanceRelation", + "ProcessRelation", + ].includes(dashboardStore.entity) ? selectorStore.currentPod && selectorStore.currentPod.value : undefined, endpointName: dashboardStore.entity.includes("Endpoint") ? selectorStore.currentPod && selectorStore.currentPod.value : undefined, + processName: dashboardStore.entity.includes("Process") + ? selectorStore.currentProcess && selectorStore.currentProcess.value + : undefined, destNormal: isRelation ? selectorStore.currentDestService.normal : undefined, destServiceName: isRelation ? selectorStore.currentDestService.value : undefined, - destServiceInstanceName: - dashboardStore.entity === "ServiceInstanceRelation" - ? selectorStore.currentDestPod && - selectorStore.currentDestPod.value - : undefined, + destServiceInstanceName: [ + "ServiceInstanceRelation", + "ProcessRelation", + ].includes(dashboardStore.entity) + ? selectorStore.currentDestPod && selectorStore.currentDestPod.value + : undefined, destEndpointName: dashboardStore.entity === "EndpointRelation" ? selectorStore.currentDestPod && selectorStore.currentDestPod.value : undefined, + destProcessName: dashboardStore.entity.includes("ProcessRelation") + ? selectorStore.currentDestProcess && + selectorStore.currentDestProcess.value + : undefined, }, }; } diff --git a/src/views/dashboard/graphs/ServiceList.vue b/src/views/dashboard/graphs/ServiceList.vue index e9d6bb6a..bfeb4553 100644 --- a/src/views/dashboard/graphs/ServiceList.vue +++ b/src/views/dashboard/graphs/ServiceList.vue @@ -82,6 +82,7 @@ import type { PropType } from "vue"; import { ServiceListConfig } from "@/types/dashboard"; import { useSelectorStore } from "@/store/modules/selectors"; import { useDashboardStore } from "@/store/modules/dashboard"; +import { useAppStoreWithOut } from "@/store/modules/app"; import { Service } from "@/types/selector"; import { useQueryPodsMetrics, usePodsSource } from "@/hooks/useProcessor"; import { EntityType } from "../data"; @@ -111,6 +112,7 @@ const props = defineProps({ }); const selectorStore = useSelectorStore(); const dashboardStore = useDashboardStore(); +const appStore = useAppStoreWithOut(); const chartLoading = ref(false); const pageSize = 10; const services = ref([]); @@ -273,6 +275,14 @@ watch( queryServiceMetrics(services.value); } ); +watch( + () => appStore.durationTime, + () => { + if (dashboardStore.entity === EntityType[1].value) { + queryServices(); + } + } +);