summaryrefslogtreecommitdiff
path: root/web/share
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-09-07 10:42:54 +0300
committerDevaev Maxim <[email protected]>2020-09-07 10:42:54 +0300
commitb56ff5034adab8d31bcad5d0a202de0ea18c437d (patch)
treeb166f99de5742ed9e11b3892fabc0ab51aaa7ff5 /web/share
parent73d0656f645b644d053edea6ec39ace481ed61ab (diff)
fixed switch
Diffstat (limited to 'web/share')
-rw-r--r--web/share/js/kvm/gpio.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/share/js/kvm/gpio.js b/web/share/js/kvm/gpio.js
index 56bd5d14..cbbe219b 100644
--- a/web/share/js/kvm/gpio.js
+++ b/web/share/js/kvm/gpio.js
@@ -48,9 +48,13 @@ export function Gpio() {
for (let type of ["switch", "button"]) {
let el = $(`gpio-${type}-${channel}`);
if (el) {
- wm.switchEnabled(el, !state.outputs[channel].busy);
+ wm.switchEnabled(el, state.outputs[channel].online && !state.outputs[channel].busy);
}
}
+ let el = $(`gpio-switch-${channel}`);
+ if (el) {
+ el.checked = state.outputs[channel].state;
+ }
}
} else {
for (let el of $$$(".gpio-led")) {