diff --git a/src/hooks/useProcessor.ts b/src/hooks/useProcessor.ts index 3615df83..97b22e4d 100644 --- a/src/hooks/useProcessor.ts +++ b/src/hooks/useProcessor.ts @@ -399,7 +399,7 @@ export function usePodsSource( } d[key]["values"] = values; if (idx === 0) { - names.push(item.label); + names.push(key); metricConfigArr.push({ ...c, index: i }); metricTypesArr.push(config.metricTypes[index]); } diff --git a/src/views/dashboard/graphs/EndpointList.vue b/src/views/dashboard/graphs/EndpointList.vue index 456b936f..f7d30090 100644 --- a/src/views/dashboard/graphs/EndpointList.vue +++ b/src/views/dashboard/graphs/EndpointList.vue @@ -177,11 +177,16 @@ async function searchList() { await queryEndpoints(); } watch( - () => [...(props.config.metricTypes || []), ...(props.config.metrics || [])], + () => [ + ...(props.config.metricTypes || []), + ...(props.config.metrics || []), + ...(props.config.metricConfig || []), + ], (data, old) => { if (JSON.stringify(data) === JSON.stringify(old)) { return; } + metricConfig.value = props.config.metricConfig; queryEndpointMetrics(endpoints.value); } ); @@ -191,16 +196,6 @@ watch( queryEndpoints(); } ); -watch( - () => [...(props.config.metricConfig || [])], - (data, old) => { - if (JSON.stringify(data) === JSON.stringify(old)) { - return; - } - metricConfig.value = data; - queryEndpointMetrics(endpoints.value); - } -);