You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by qi...@apache.org on 2022/04/15 03:25:38 UTC

[skywalking-booster-ui] branch main updated: fix metrics index (#67)

This is an automated email from the ASF dual-hosted git repository.

qiuxiafan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-booster-ui.git


The following commit(s) were added to refs/heads/main by this push:
     new f222083  fix metrics index (#67)
f222083 is described below

commit f22208395a992475d9c1752062f5252109d79fa7
Author: Fine0830 <fi...@outlook.com>
AuthorDate: Fri Apr 15 11:25:33 2022 +0800

    fix metrics index (#67)
---
 src/views/dashboard/configuration/widget/metric/Index.vue | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/views/dashboard/configuration/widget/metric/Index.vue b/src/views/dashboard/configuration/widget/metric/Index.vue
index e76324f..3a63c06 100644
--- a/src/views/dashboard/configuration/widget/metric/Index.vue
+++ b/src/views/dashboard/configuration/widget/metric/Index.vue
@@ -203,16 +203,13 @@ async function setMetricType(chart?: any) {
     }
   );
   const metrics: any = states.metricList.filter(
-    (d: { value: string; type: string }) => {
-      const index = states.metrics.findIndex((m: string) => m === d.value);
-      if (index > -1) {
-        return d;
-      }
-    }
+    (d: { value: string; type: string }) => states.metrics.includes(d.value)
   );
 
   if (metrics.length) {
-    states.metrics = metrics.map((d: { value: string }) => d.value);
+    // keep states.metrics index
+    const m = metrics.map((d: { value: string }) => d.value);
+    states.metrics = states.metrics.filter((d) => m.includes(d));
   } else {
     states.metrics = [""];
     states.metricTypes = [""];