diff options
author | Devaev Maxim <[email protected]> | 2020-12-03 10:04:06 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-12-03 10:04:06 +0300 |
commit | b9cf8f974dc126f7760fea9657e407e753ffe7d7 (patch) | |
tree | 52b73a562181f7ce09764f489f694d3746e22412 /web/share/js/kvm/keyboard.js | |
parent | be6b81af9c338430d018bf544f117d683a555814 (diff) |
separate state for hid offline
Diffstat (limited to 'web/share/js/kvm/keyboard.js')
-rw-r--r-- | web/share/js/kvm/keyboard.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/web/share/js/kvm/keyboard.js b/web/share/js/kvm/keyboard.js index e919a840..db024917 100644 --- a/web/share/js/kvm/keyboard.js +++ b/web/share/js/kvm/keyboard.js @@ -73,8 +73,12 @@ export function Keyboard(record_callback) { __updateOnlineLeds(); }; - self.setState = function(state) { - __online = state.online; + self.setState = function(state, hid_online, hid_busy) { + if (!hid_online) { + __online = null; + } else { + __online = (state.online && !hid_busy); + } __updateOnlineLeds(); for (let led of ["caps", "scroll", "num"]) { @@ -107,14 +111,17 @@ export function Keyboard(record_callback) { let title = "Keyboard free"; if (__ws) { - if (__online) { + if (__online === null) { + led = "led-red"; + title = (is_captured ? "Keyboard captured, HID offline" : "Keyboard free, HID offline"); + } else if (__online) { if (is_captured) { led = "led-green"; title = "Keyboard captured"; } } else { led = "led-yellow"; - title = (is_captured ? "Keyboard captured, HID offline" : "Keyboard free, HID offline"); + title = (is_captured ? "Keyboard captured, inactive/busy" : "Keyboard free, inactive/busy"); } } else { if (is_captured) { |