From 15615a74cf4762236e732db661596e5a5b0e5f7c Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Fri, 25 Mar 2022 22:19:52 +0800 Subject: [PATCH] fix config --- src/views/dashboard/graphs/EndpointList.vue | 4 ++-- src/views/dashboard/graphs/InstanceList.vue | 4 ++-- src/views/dashboard/graphs/ServiceList.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/dashboard/graphs/EndpointList.vue b/src/views/dashboard/graphs/EndpointList.vue index 442d0062..d9da5bae 100644 --- a/src/views/dashboard/graphs/EndpointList.vue +++ b/src/views/dashboard/graphs/EndpointList.vue @@ -120,7 +120,6 @@ const endpoints = ref([]); const pageSize = 5; const total = 10; const searchText = ref(""); -const metricConfig = ref(props.config.metricConfig || []); queryEndpoints(total); @@ -157,9 +156,10 @@ async function queryEndpointMetrics(currentPods: Endpoint[]) { ElMessage.error(json.errors); return; } + const metricConfig = props.config.metricConfig || []; endpoints.value = usePodsSource(currentPods, json, { ...props.config, - metricConfig: metricConfig.value, + metricConfig: metricConfig, }); return; } diff --git a/src/views/dashboard/graphs/InstanceList.vue b/src/views/dashboard/graphs/InstanceList.vue index 8799c645..fa49424a 100644 --- a/src/views/dashboard/graphs/InstanceList.vue +++ b/src/views/dashboard/graphs/InstanceList.vue @@ -145,7 +145,6 @@ const instances = ref([]); // current instances const searchInstances = ref([]); // all instances const pageSize = 5; const searchText = ref(""); -const metricConfig = ref(props.config.metricConfig || []); queryInstance(); async function queryInstance() { @@ -182,9 +181,10 @@ async function queryInstanceMetrics(currentInstances: Instance[]) { ElMessage.error(json.errors); return; } + const metricConfig = props.config.metricConfig || []; instances.value = usePodsSource(currentInstances, json, { ...props.config, - metricConfig: metricConfig.value, + metricConfig, }); return; } diff --git a/src/views/dashboard/graphs/ServiceList.vue b/src/views/dashboard/graphs/ServiceList.vue index 2aea5d2f..682acb13 100644 --- a/src/views/dashboard/graphs/ServiceList.vue +++ b/src/views/dashboard/graphs/ServiceList.vue @@ -133,7 +133,6 @@ const services = ref([]); const searchText = ref(""); const groups = ref({}); const sortServices = ref<(Service & { merge: boolean })[]>([]); -const metricConfig = ref(props.config.metricConfig || []); queryServices(); @@ -216,9 +215,10 @@ async function queryServiceMetrics(currentServices: Service[]) { ElMessage.error(json.errors); return; } + const metricConfig = props.config.metricConfig || []; services.value = usePodsSource(currentServices, json, { ...props.config, - metricConfig: metricConfig.value || [], + metricConfig: metricConfig || [], }); return; }