summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/mouse.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-02-07 05:45:36 +0300
committerDevaev Maxim <[email protected]>2019-02-07 05:45:36 +0300
commitde1bed956cc714e8b750e3df22a563eac0800876 (patch)
tree8d5bea19bd8380313eab5ee1cdfb75784fdb3dc7 /web/share/js/kvm/mouse.js
parent5bec2ff1449832be374d69ece14e7a63d5d7379a (diff)
new hid protocol with crc
Diffstat (limited to 'web/share/js/kvm/mouse.js')
-rw-r--r--web/share/js/kvm/mouse.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index 59b3fc73..75836b1d 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -4,6 +4,7 @@ function Mouse() {
/********************************************************************************/
var __ws = null;
+ var __ok = true;
var __current_pos = {x: 0, y:0};
var __sent_pos = {x: 0, y:0};
@@ -44,6 +45,10 @@ function Mouse() {
__updateLeds();
};
+ self.setState = function(state) {
+ __ok = state.ok;
+ };
+
var __hoverStream = function() {
__stream_hovered = true;
__updateLeds();
@@ -57,8 +62,13 @@ function Mouse() {
var __updateLeds = function() {
if (__ws && (__stream_hovered || tools.browser.is_ios)) {
// Mouse is always available on iOS via touchscreen
- $("hid-mouse-led").className = "led-green";
- $("hid-mouse-led").title = "Mouse tracked";
+ if (__ok) {
+ $("hid-mouse-led").className = "led-green";
+ $("hid-mouse-led").title = "Mouse tracked";
+ } else {
+ $("hid-mouse-led").className = "led-yellow";
+ $("hid-mouse-led").title = "Mouse tracked, HID offline";
+ }
} else {
$("hid-mouse-led").className = "led-gray";
$("hid-mouse-led").title = "Mouse free";