diff --git a/static/rbmd/script.js b/static/rbmd/script.js index 07b8cd5..1fa6c62 100644 --- a/static/rbmd/script.js +++ b/static/rbmd/script.js @@ -1,4 +1,15 @@ $(function() { + var url = "ws://" + location.host + "/socket"; + var ws = new WebSocket(url); + var a, selected_node, deadNode, node2; + ws.onopen = function() {ws.send(""); }; + ws.onmessage = function (evt) { + a = JSON.parse(evt.data); + displayData(a); + }; + $('.tablink').css('display', 'block'); + + $('#mountFormTrigger').click(function(event){ var htmlSelect = ''; a.quorum.forEach(function(item) { @@ -16,15 +27,7 @@ $(function() { } }) */ - var url = "ws://" + location.host + "/socket"; - var ws = new WebSocket(url); - var a, selected_node, deadNode, node2; - ws.onopen = function() {ws.send(""); }; - ws.onmessage = function (evt) { - a = JSON.parse(evt.data); - displayData(a); - }; - $('.tablink').css('display', 'block'); + })