diff options
author | Devaev Maxim <[email protected]> | 2018-10-09 16:20:41 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-10-09 16:20:41 +0300 |
commit | a449b39c52392d0d8b043934a15792f21d54e06d (patch) | |
tree | c8ff6a67baea441b61ea14f0363ba4b22c0cd116 /web/js/session.js | |
parent | 2c241fab4409eac3b40762d2c23d42ac6e3f8df1 (diff) |
refactoring
Diffstat (limited to 'web/js/session.js')
-rw-r--r-- | web/js/session.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/web/js/session.js b/web/js/session.js index 3169c8c1..19df05cc 100644 --- a/web/js/session.js +++ b/web/js/session.js @@ -33,12 +33,12 @@ function Session(atx, hid, msd) { }; var __startPoller = function() { - $("link-led").className = "led-link-connecting"; + $("link-led").className = "led-yellow"; $("link-led").title = "Connecting..."; var http = tools.makeRequest("GET", "/wsauth", function() { if (http.readyState === 4) { if (http.status === 200) { - __ws = new WebSocket((location.protocol == "https:" ? "wss" : "ws") + "://" + location.host + "/kvmd/ws"); + __ws = new WebSocket((location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/kvmd/ws"); __ws.onopen = __wsOpenHandler; __ws.onmessage = __wsMessageHandler; __ws.onerror = __wsErrorHandler; @@ -51,7 +51,7 @@ function Session(atx, hid, msd) { }; var __wsOpenHandler = function(event) { - $("link-led").className = "led-on"; + $("link-led").className = "led-green"; $("link-led").title = "Connected"; tools.debug("WebSocket opened:", event); atx.loadInitialState(); @@ -85,7 +85,7 @@ function Session(atx, hid, msd) { }; var __wsCloseHandler = function(event) { - $("link-led").className = "led-off"; + $("link-led").className = "led-gray"; tools.debug("WebSocket closed:", event); if (__ping_timer) { clearInterval(__ping_timer); @@ -95,7 +95,7 @@ function Session(atx, hid, msd) { atx.clearState(); __ws = null; setTimeout(function() { - $("link-led").className = "led-link-connecting"; + $("link-led").className = "led-yellow"; setTimeout(__startPoller, 500); }, 500); }; |