From 7eab75b9e971524990228d1910e97d9f0bb0f6d3 Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期一, 19 十月 2020 15:29:28 +0800
Subject: [PATCH] 集群云大小在一定范围内跟随节点数量变化

---
 src/pages/settings/components/ClusterManagement.vue |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/pages/settings/components/ClusterManagement.vue b/src/pages/settings/components/ClusterManagement.vue
index f9aa80c..51173b1 100644
--- a/src/pages/settings/components/ClusterManagement.vue
+++ b/src/pages/settings/components/ClusterManagement.vue
@@ -288,11 +288,19 @@
       agentName: "",
       members: [],
       innerNodes: [],
+      intervalTimer: null,
     };
   },
   mounted() {
     this.findCluster();
+    let _this = this;
+    this.intervalTimer = setInterval(()=>{
+      _this.findCluster();
+    },30000);
     this.getEsClusterNodes();
+  },
+  beforeDestroy(){
+    clearInterval(this.intervalTimer);
   },
   methods: {
     cleanValue() {
@@ -505,7 +513,7 @@
             obj.node_ip = i.node_ip;
             obj.nodeName = i.node_name;
             obj.Address = i.node_ip;
-            obj.role = i.role ? i.role : "pc";
+            obj.role = i.drift_state ? i.drift_state : "pc";
             return obj;
           });
 

--
Gitblit v1.8.0