From b56ff5034adab8d31bcad5d0a202de0ea18c437d Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Mon, 7 Sep 2020 10:42:54 +0300 Subject: [PATCH] fixed switch --- web/share/js/kvm/gpio.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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")) {