summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/mouse.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-02-08 03:02:58 +0300
committerDevaev Maxim <[email protected]>2019-02-08 03:02:58 +0300
commite22426155dc3a05c8ce15fc7fbfd3df80aa57bfb (patch)
tree669587d077973b28145481387bff2d152d57695c /web/share/js/kvm/mouse.js
parent686f2a8bd4bdd9abc76aa0ebeca48e80faeef60f (diff)
hid: led-yellow preferred
Diffstat (limited to 'web/share/js/kvm/mouse.js')
-rw-r--r--web/share/js/kvm/mouse.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index 3f81a833..13807ec7 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -61,19 +61,27 @@ function Mouse() {
};
var __updateLeds = function() {
- if (__ws && (__stream_hovered || tools.browser.is_ios)) {
- // Mouse is always available on iOS via touchscreen
- if (__ok) {
- $("hid-mouse-led").className = "led-green";
- $("hid-mouse-led").title = "Mouse tracked";
+ var is_captured = (__stream_hovered || tools.browser.is_ios);
+ var led = "led-gray";
+ var title = "Mouse free";
+
+ if (__ws) {
+ if (__ok) {
+ if (is_captured) {
+ led = "led-green";
+ title = "Mouse captured";
+ }
} else {
- $("hid-mouse-led").className = "led-yellow";
- $("hid-mouse-led").title = "Mouse tracked, HID offline";
+ led = "led-yellow";
+ title = (is_captured ? "Mouse captured, HID offline" : "Mouse free, HID offline");
}
} else {
- $("hid-mouse-led").className = "led-gray";
- $("hid-mouse-led").title = "Mouse free";
+ if (is_captured) {
+ title = "Mouse captured, Pi-KVM offline";
+ }
}
+ $("hid-mouse-led").className = led;
+ $("hid-mouse-led").title = title;
};
var __buttonHandler = function(event, state) {