From a1001a1285c45fe1e82b54c7ae30234305cf3211 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Thu, 17 Feb 2022 20:52:19 +0800 Subject: [PATCH] fix: add conditions --- .../related/topology/components/Settings.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/views/dashboard/related/topology/components/Settings.vue b/src/views/dashboard/related/topology/components/Settings.vue index 4a03e200..07b53347 100644 --- a/src/views/dashboard/related/topology/components/Settings.vue +++ b/src/views/dashboard/related/topology/components/Settings.vue @@ -236,6 +236,11 @@ async function getMetricList() { ); } async function setLegend() { + if ( + !(legend.metric.name && legend.metric.value && legend.metric.condidtion) + ) { + return; + } updateSettings(); const ids = topologyStore.nodes.map((d: Node) => d.id); const param = await useQueryTopologyMetrics([legend.metric.name], ids); @@ -249,12 +254,12 @@ async function setLegend() { function changeLegend(type: string, opt: any) { legend.metric[type] = opt[0].value || opt; } -function changeCondition(opt: Option[]) { - legend.condition = opt[0].value; -} -function changeLegendMetric(type: string, opt: any) { - legend.secondMetric[type] = opt[0].value || opt; -} +// function changeCondition(opt: Option[]) { +// legend.condition = opt[0].value; +// } +// function changeLegendMetric(type: string, opt: any) { +// legend.secondMetric[type] = opt[0].value || opt; +// } function changeScope(index: number, opt: Option[]) { items[index].scope = opt[0].value; items[index].dashboard = "";