From 1ebbf30f8e2c42c323cb530e80b148dbb677c9fd Mon Sep 17 00:00:00 2001 From: Anna Date: Mon, 26 Mar 2018 23:03:58 +0300 Subject: [PATCH] upd --- static/rbmd/script.js | 9 +++++++++ templates/rbmd/index.html | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/static/rbmd/script.js b/static/rbmd/script.js index 7203c1c..07b8cd5 100644 --- a/static/rbmd/script.js +++ b/static/rbmd/script.js @@ -16,6 +16,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'); }) diff --git a/templates/rbmd/index.html b/templates/rbmd/index.html index f0b5630..c745b1e 100644 --- a/templates/rbmd/index.html +++ b/templates/rbmd/index.html @@ -84,16 +84,16 @@