From 3b4792882be0129f787b21602f67d1f70d7bfdaa Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Wed, 23 Nov 2022 04:45:21 +0300 Subject: web: locator switch --- testenv/v2-hdmi-rpi4.override.yaml | 10 ++++++++++ web/kvm/index.html | 9 +++++++++ web/kvm/navbar-system.pug | 9 +++++++++ web/share/js/kvm/gpio.js | 1 + 4 files changed, 29 insertions(+) diff --git a/testenv/v2-hdmi-rpi4.override.yaml b/testenv/v2-hdmi-rpi4.override.yaml index adb67907..7160a090 100644 --- a/testenv/v2-hdmi-rpi4.override.yaml +++ b/testenv/v2-hdmi-rpi4.override.yaml @@ -40,6 +40,9 @@ kvmd: drivers: __gpio__: device: /dev/kvmd-gpio + __v4_locator__: + type: locator + device: /dev/kvmd-gpio relay: type: hidrelay device: /dev/hidraw0 @@ -58,6 +61,13 @@ kvmd: pulse: delay: 0 + __v4_locator__: + driver: __v4_locator__ + pin: 12 + mode: output + pulse: + delay: 0 + led1: pin: 19 mode: input diff --git a/web/kvm/index.html b/web/kvm/index.html index 55ccad0b..3d852763 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -325,6 +325,15 @@ + + Enable locator LED: + +
+ + +
+ + Ask page close confirmation: diff --git a/web/kvm/navbar-system.pug b/web/kvm/navbar-system.pug index c3367696..ea8cd6b8 100644 --- a/web/kvm/navbar-system.pug +++ b/web/kvm/navbar-system.pug @@ -100,6 +100,15 @@ li(id="system-dropdown" class="right") label(for="gpio-switch-__v3_usb_breaker__") span(class="switch-inner") span(class="switch") + tr(id="v4-locator" class="feature-disabled") + td Enable locator LED: + td(align="right") + div(class="switch-box") + input(disabled type="checkbox" id="gpio-switch-__v4_locator__" class="gpio-switch" + data-channel="__v4_locator__") + label(for="gpio-switch-__v4_locator__") + span(class="switch-inner") + span(class="switch") tr +menu_switch_notable("page-close-ask-switch", "Ask page close confirmation", true, true) hr diff --git a/web/share/js/kvm/gpio.js b/web/share/js/kvm/gpio.js index 08ec42a8..cf319c95 100644 --- a/web/share/js/kvm/gpio.js +++ b/web/share/js/kvm/gpio.js @@ -114,6 +114,7 @@ export function Gpio(__recorder) { } tools.feature.setEnabled($("v3-usb-breaker"), ("__v3_usb_breaker__" in model.scheme.outputs)); + tools.feature.setEnabled($("v4-locator"), ("__v4_locator__" in model.scheme.outputs)); tools.feature.setEnabled($("system-tool-wol"), ("__wol__" in model.scheme.outputs)); self.setState(__state); -- cgit v1.2.3