summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-08-12 07:30:48 +0300
committerDevaev Maxim <[email protected]>2018-08-12 07:30:48 +0300
commit43fa2cc2ff9527a5a3f874c56d32bfcc45c95e61 (patch)
tree6778be8f0ee330c36a49a6f7eb5672aa11bddaf9
parent159c399fb870700369fba35ce99fb7581009ac9b (diff)
connecting state for link led
-rw-r--r--kvmd/web/css/leds.css5
-rw-r--r--kvmd/web/js/session.js8
2 files changed, 12 insertions, 1 deletions
diff --git a/kvmd/web/css/leds.css b/kvmd/web/css/leds.css
index 6558eb35..cd3ee508 100644
--- a/kvmd/web/css/leds.css
+++ b/kvmd/web/css/leds.css
@@ -33,6 +33,11 @@ img.led-pak-typing {
animation: spin 2s linear infinite;
}
+img.led-link-connecting {
+ -webkit-filter: invert(0.5) sepia(1) saturate(5) hue-rotate(0deg);
+ filter: invert(0.5) sepia(1) saturate(5) hue-rotate(0deg);
+}
+
img.led-fan-on {
-webkit-filter: invert(0.5) sepia(1) saturate(5) hue-rotate(100deg);
filter: invert(0.5) sepia(1) saturate(5) hue-rotate(100deg);
diff --git a/kvmd/web/js/session.js b/kvmd/web/js/session.js
index 5e4a491b..f52b3dde 100644
--- a/kvmd/web/js/session.js
+++ b/kvmd/web/js/session.js
@@ -20,6 +20,8 @@ var session = new function() {
};
this.startPoller = function() {
+ $("link-led").className = "led-link-connecting";
+ $("link-led").title = "Connecting...";
var http = tools.makeRequest("GET", "/wsauth", function() {
if (http.readyState === 4) {
if (http.status === 200) {
@@ -37,6 +39,7 @@ var session = new function() {
var __wsOpenHandler = function(event) {
$("link-led").className = "led-on";
+ $("link-led").title = "Connected";
tools.debug("WebSocket opened:", event);
atx.loadInitialState();
msd.loadInitialState();
@@ -80,7 +83,10 @@ var session = new function() {
hid.setSocket(null);
atx.clearState();
__ws = null;
- setTimeout(session.startPoller, 1000);
+ setTimeout(function() {
+ $("link-led").className = "led-link-connecting";
+ setTimeout(session.startPoller, 500);
+ }, 500);
};
var __pingServer = function() {