From 9e21364a655afc2083ab9db6f08207af7bb8cdc6 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Fri, 1 Apr 2022 11:03:12 +0800 Subject: [PATCH] add label --- .../configuration/widget/metric/Standard.vue | 15 +++++++++---- src/views/dashboard/graphs/ServiceList.vue | 21 ++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/views/dashboard/configuration/widget/metric/Standard.vue b/src/views/dashboard/configuration/widget/metric/Standard.vue index 47a3fbf6..16204121 100644 --- a/src/views/dashboard/configuration/widget/metric/Standard.vue +++ b/src/views/dashboard/configuration/widget/metric/Standard.vue @@ -26,7 +26,7 @@ limitations under the License. --> " /> -
+
{{ t("labels") }} " />
-
+
{{ t("labelsIndex") }} ({ }); const metricTypes = dashboardStore.selectedGrid.metricTypes || []; const metricType = ref(metricTypes[props.index]); +const hasLabel = computed(() => { + const graph = dashboardStore.selectedGrid.graph || {}; + return ( + ListChartTypes.includes(graph.type) || + metricType.value === "readLabeledMetricsValues" + ); +}); const isTopn = computed(() => ["sortMetrics", "readSampledRecords"].includes(metricTypes[props.index]) ); @@ -121,7 +129,7 @@ function updateConfig(index: number, param: { [key: string]: string }) { if (!key) { return; } - changeConfigs(index, { key: decodeURIComponent(param[key]) }); + changeConfigs(index, { [key]: decodeURIComponent(param[key]) }); } function changeConfigs( index: number, @@ -130,7 +138,6 @@ function changeConfigs( const metricConfig = dashboardStore.selectedGrid.metricConfig || []; metricConfig[index] = { ...metricConfig[index], ...param }; - currentMetric.value = metricConfig[index]; dashboardStore.selectWidget({ ...dashboardStore.selectedGrid, metricConfig, diff --git a/src/views/dashboard/graphs/ServiceList.vue b/src/views/dashboard/graphs/ServiceList.vue index 8147ef0e..00f6fd68 100644 --- a/src/views/dashboard/graphs/ServiceList.vue +++ b/src/views/dashboard/graphs/ServiceList.vue @@ -56,7 +56,9 @@ limitations under the License. -->