diff --git a/nodes/core/58-debug.html b/nodes/core/58-debug.html index d3d9e04e8..fd96fbc7e 100644 --- a/nodes/core/58-debug.html +++ b/nodes/core/58-debug.html @@ -113,10 +113,16 @@ var sbc = document.getElementById("debug-content"); + var errornotification = null; + function debugConnect() { //console.log("debug ws connecting"); var ws = new WebSocket("ws://"+location.hostname+":"+location.port+document.location.pathname+"/debug"); ws.onopen = function() { + if (errornotification) { + errornotification.close(); + errornotification = null; + } //console.log("debug ws connected"); } ws.onmessage = function(event) { @@ -158,7 +164,9 @@ } }; ws.onclose = function() { - //console.log("debug ws closed"); + if (errornotification == null) { + errornotification = RED.notify("Error: Lost connection to server","error",true); + } setTimeout(debugConnect,1000); } } diff --git a/public/red/ui/notifications.js b/public/red/ui/notifications.js index e0e26bc04..3150046ed 100644 --- a/public/red/ui/notifications.js +++ b/public/red/ui/notifications.js @@ -16,14 +16,22 @@ RED.notify = function() { var currentNotifications = []; var c = 0; - return function(msg,type) { - while (currentNotifications.length > 4) { - var n = currentNotifications[0]; - window.clearTimeout(n.id); - n.slideup(); + return function(msg,type,fixed) { + if (currentNotifications.length > 4) { + var ll = currentNotifications.length; + for (var i = 0;ll > 4 && i