diff --git a/static/rbmd/script.js b/static/rbmd/script.js index e66c4f5..fb1b9a8 100644 --- a/static/rbmd/script.js +++ b/static/rbmd/script.js @@ -67,8 +67,19 @@ function displayData(a){ $("#statusContainer:contains('alive')").css("background-color", "#4CAF50"); $("#statusContainer:contains('resizing')").css("background-color", "#ff9800"); $("#statusContainer:contains('deadly')").css("background-color", "#f44336");; - var node2 = a; - w3DisplayData("id01", node2); + if (node2 != undefined) { + var one = a.quorum.map(function(item) {return item.node}); + var two = node2.quorum.map(function(item) {return item.node}); + if (JSON.stringify(one) != JSON.stringify(two)) { + console.log('upd'); + node2 = a; + w3DisplayData("id01", node2); + } + } else { + console.log('upd'); + node2 = a; + w3DisplayData("id01", node2); + } $('.tablink').css('display', 'block'); if (selected_node != undefined && selected_node != 'dead'){ //a.quorum.forEach(function(item) {if (item.node == selected_node) { console.log(item.node)}}) diff --git a/templates/rbmd/index.html b/templates/rbmd/index.html index 30c958f..c27c345 100644 --- a/templates/rbmd/index.html +++ b/templates/rbmd/index.html @@ -29,7 +29,7 @@

Leader:

Nodes:

- + {{!node}}

Metrics:

@@ -85,7 +85,7 @@