diff options
author | Devaev Maxim <[email protected]> | 2018-07-17 00:44:38 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-17 00:44:38 +0300 |
commit | 514aac8d82241e2907d4d7672765912020d742dc (patch) | |
tree | e25570aa37d14a9fb8a31758212fc0985c131e27 /kvmd/web/js/session.js | |
parent | caf7f4c99bce4533e7fc1b9f7aeaaf605baf819c (diff) |
real-time icons and buttons state
Diffstat (limited to 'kvmd/web/js/session.js')
-rw-r--r-- | kvmd/web/js/session.js | 10 |
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); }; |