From 8a45ce9146df3aa7c53b75c08ae0a4655e013ce2 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Thu, 14 Jan 2021 23:29:52 +0300 Subject: v3 usb breaker --- web/kvm/index.html | 12 ++++++++++++ web/kvm/navbar-system.pug | 13 +++++++++++++ web/share/js/kvm/gpio.js | 18 ++++++++++++------ 3 files changed, 37 insertions(+), 6 deletions(-) (limited to 'web') diff --git a/web/kvm/index.html b/web/kvm/index.html index 1d920cee..10f72b28 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -196,6 +196,18 @@
+
+ + + +
Connect main USB to Server: +
+ + +
+
+
+
diff --git a/web/kvm/navbar-system.pug b/web/kvm/navbar-system.pug index cbf7ab6c..26876cab 100644 --- a/web/kvm/navbar-system.pug +++ b/web/kvm/navbar-system.pug @@ -49,6 +49,19 @@ li(class="right") hr +menu_switch("hid-connect-switch", "Connect HID to Server", true, true) hr + div(id="v3-usb-breaker" class="feature-disabled") + table(class="kv") + td Connect main USB to Server: + td(align="right") + div(class="switch-box") + -let msg = "Turning off this switch will disconnect the main USB
from the server." + -msg += " Are you sure you want to continue?" + input(disabled type="checkbox" id="gpio-switch-__v3_usb_breaker__" class="gpio-switch" + data-channel="__v3_usb_breaker__" data-confirm-off=msg) + label(for="gpio-switch-__v3_usb_breaker__") + span(class="switch-inner") + span(class="switch") + hr div(class="buttons buttons-row") button(data-force-hide-menu id="show-keyboard-button" class="row50") • Show keyboard button(disabled id="hid-reset-button" class="row50") Reset HID diff --git a/web/share/js/kvm/gpio.js b/web/share/js/kvm/gpio.js index e874c81d..9a339da6 100644 --- a/web/share/js/kvm/gpio.js +++ b/web/share/js/kvm/gpio.js @@ -104,6 +104,8 @@ export function Gpio() { } } + tools.featureSetEnabled($("v3-usb-breaker"), ("__v3_usb_breaker__" in model.scheme.outputs)); + self.setState(__state); }; @@ -121,11 +123,12 @@ export function Gpio() { `; } else if (item.type === "output") { let controls = []; + let confirm = (item.confirm ? "Are you sure to act this control?" : ""); if (item.scheme["switch"]) { controls.push(`
+ data-channel="${item.channel}" data-confirm="${confirm}" />