From 070157d271040143cc15846c461872de0e4a9c69 Mon Sep 17 00:00:00 2001 From: Fine Date: Thu, 11 Apr 2024 16:02:24 +0800 Subject: [PATCH] fix: clean up --- src/store/modules/topology.ts | 3 --- src/views/dashboard/List.vue | 10 +--------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/store/modules/topology.ts b/src/store/modules/topology.ts index d997f866..1a399134 100644 --- a/src/store/modules/topology.ts +++ b/src/store/modules/topology.ts @@ -225,9 +225,6 @@ export const topologyStore = defineStore({ setNodeMetricValue(m: MetricVal) { this.nodeMetricValue = m; }, - setNodeValue(m: MetricVal) { - this.nodeMetricValue = m; - }, setLegendValues(expressions: string, data: { [key: string]: any }) { for (let idx = 0; idx < this.nodes.length; idx++) { for (let index = 0; index < expressions.length; index++) { diff --git a/src/views/dashboard/List.vue b/src/views/dashboard/List.vue index e57a92df..65bb404f 100644 --- a/src/views/dashboard/List.vue +++ b/src/views/dashboard/List.vue @@ -304,6 +304,7 @@ limitations under the License. --> async function importTemplates(event: any) { const arr: any = await readFile(event); + for (const item of arr) { const { layer, name, entity } = item.configuration; const index = dashboardStore.dashboards.findIndex( @@ -390,17 +391,8 @@ limitations under the License. --> if (isEmptyObject(child.widget)) { delete child.widget; } - if (!(child.metrics && child.metrics.length && child.metrics[0])) { - delete child.metrics; - } - if (!(child.metricTypes && child.metricTypes.length && child.metricTypes[0])) { - delete child.metricTypes; - } if (child.metricConfig && child.metricConfig.length) { child.metricConfig.forEach((c, index) => { - if (!c.calculation) { - delete c.calculation; - } if (!c.unit) { delete c.unit; }