From 11eaebedd13e06d90fc4f803ff951520bafb95a5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 21 Sep 2017 16:32:42 -0500 Subject: [PATCH] Fix log watch streaming issue where if you page away and page back - messages aren't being drawn until you refresh --- public/assets/js/glass-pages/dhcp-logs.js | 1 + public/assets/js/glass-websockets.js | 2 +- public/templates/api_examples.html | 2 +- public/templates/dhcp_log.html | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/assets/js/glass-pages/dhcp-logs.js b/public/assets/js/glass-pages/dhcp-logs.js index 97e7f72..39f09de 100644 --- a/public/assets/js/glass-pages/dhcp-logs.js +++ b/public/assets/js/glass-pages/dhcp-logs.js @@ -4,6 +4,7 @@ function log_action (action){ socket.send(JSON.stringify({"event_unsubscribe": "dhcp_log_subscription"})); break; case "start": + killed_connection = 0; console.log('start readystate is ' + socket.readyState); socket.send(JSON.stringify({"event_subscription": "dhcp_log_subscription"})); break; diff --git a/public/assets/js/glass-websockets.js b/public/assets/js/glass-websockets.js index c96ab7f..a13bf79 100644 --- a/public/assets/js/glass-websockets.js +++ b/public/assets/js/glass-websockets.js @@ -6,7 +6,7 @@ function check_websocket_connection () { } function connect_websocket() { - var killed_connection = 0; + killed_connection = 0; delete socket; socket = new WebSocket("ws://" + window.location.hostname + ":8080"); diff --git a/public/templates/api_examples.html b/public/templates/api_examples.html index 3438c24..dba812c 100644 --- a/public/templates/api_examples.html +++ b/public/templates/api_examples.html @@ -4,7 +4,7 @@

- GET: Active Leases Data + GET: Active Leases Data (Full Lease Data - this can be heavy) Drawing the JSON response in the browser screen takes longer than the response itself

diff --git a/public/templates/dhcp_log.html b/public/templates/dhcp_log.html index b40ce3c..347f5a5 100644 --- a/public/templates/dhcp_log.html +++ b/public/templates/dhcp_log.html @@ -34,4 +34,4 @@ - + \ No newline at end of file