From e8062dc2d92344d1919ca44e8b81e76bcc6825fd Mon Sep 17 00:00:00 2001 From: Fine Date: Sun, 30 Oct 2022 10:47:31 +0800 Subject: [PATCH] fix --- src/views/dashboard/graphs/ServiceList.vue | 17 ++++++----------- .../dashboard/graphs/components/ColumnGraph.vue | 1 + 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/views/dashboard/graphs/ServiceList.vue b/src/views/dashboard/graphs/ServiceList.vue index 6e9ee014..a271017f 100644 --- a/src/views/dashboard/graphs/ServiceList.vue +++ b/src/views/dashboard/graphs/ServiceList.vue @@ -276,21 +276,16 @@ function searchList() { } 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; } - queryServiceMetrics(services.value); - } -); -watch( - () => [...(props.config.metricConfig || [])], - (data, old) => { - if (JSON.stringify(data) === JSON.stringify(old)) { - return; - } - metricConfig.value = data; + metricConfig.value = props.config.metricConfig; queryServiceMetrics(services.value); } ); diff --git a/src/views/dashboard/graphs/components/ColumnGraph.vue b/src/views/dashboard/graphs/components/ColumnGraph.vue index 5034265b..efa42803 100644 --- a/src/views/dashboard/graphs/components/ColumnGraph.vue +++ b/src/views/dashboard/graphs/components/ColumnGraph.vue @@ -167,5 +167,6 @@ function getLabel(metric: string, index: string) { display: inline-block; flex-grow: 2; height: 100%; + width: calc(100% - 30px); }