summaryrefslogtreecommitdiff
path: root/kvmd/web/js/session.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-17 00:44:38 +0300
committerDevaev Maxim <[email protected]>2018-07-17 00:44:38 +0300
commit514aac8d82241e2907d4d7672765912020d742dc (patch)
treee25570aa37d14a9fb8a31758212fc0985c131e27 /kvmd/web/js/session.js
parentcaf7f4c99bce4533e7fc1b9f7aeaaf605baf819c (diff)
real-time icons and buttons state
Diffstat (limited to 'kvmd/web/js/session.js')
-rw-r--r--kvmd/web/js/session.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/kvmd/web/js/session.js b/kvmd/web/js/session.js
index b4642b62..33c8af60 100644
--- a/kvmd/web/js/session.js
+++ b/kvmd/web/js/session.js
@@ -13,6 +13,8 @@ var session = new function() {
var __wsOpenHandler = function(event) {
tools.debug("WebSocket opened:", event);
+ atx.loadInitialState();
+ msd.loadInitialState();
hid.installCapture(__ws);
__missed_heartbeats = 0;
__ping_timer = setInterval(__pingServer, 1000);
@@ -25,7 +27,11 @@ var session = new function() {
__missed_heartbeats = 0;
} else if (event.msg_type === "event") {
if (event.msg.event === "atx_state") {
- atx.setLedsState(event.msg.event_attrs.leds);
+ atx.setState(event.msg.event_attrs);
+ // } else if (event.msg.event === "atx_click") {
+ // atx.setButtonsBusy(event.msg.event_attrs.button);
+ } else if (event.msg.event === "msd_state") {
+ msd.setState(event.msg.event_attrs);
}
}
};
@@ -46,7 +52,7 @@ var session = new function() {
__ping_timer = null;
}
hid.clearCapture();
- atx.clearLeds();
+ atx.clearState();
__ws = null;
setTimeout(session.startPoller, 1000);
};