diff --git a/web/kvm/index.html b/web/kvm/index.html index 9338e756..3cb54963 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -369,22 +369,22 @@ - Connect main USB to Server: - -
- - -
- + Connect main USB to Server: + +
+ + +
+ - Enable locator LED: - -
- - -
- + Enable locator LED: + +
+ + +
+ Ask page close confirmation: diff --git a/web/kvm/navbar-system.pug b/web/kvm/navbar-system.pug index d1016d42..b4b022b1 100644 --- a/web/kvm/navbar-system.pug +++ b/web/kvm/navbar-system.pug @@ -108,25 +108,10 @@ li(id="system-dropdown" class="right") tr +menu_switch_notable("hid-mute-switch", "Mute HID input events", true, false) tr(id="v3-usb-breaker" class="feature-disabled") - 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") + +menu_switch_notable_gpio("__v3_usb_breaker__", "Connect main USB to Server", + "Turning off this switch will disconnect the main USB
from the server. Are you sure you want to continue?") 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") + +menu_switch_notable_gpio("__v4_locator__", "Enable locator LED") tr +menu_switch_notable("page-close-ask-switch", "Ask page close confirmation", true, true) hr diff --git a/web/kvm/navbar.pug b/web/kvm/navbar.pug index 98456765..ac3f0a04 100644 --- a/web/kvm/navbar.pug +++ b/web/kvm/navbar.pug @@ -13,9 +13,19 @@ mixin menu_message(icon, short, classes="") sup(style="line-height:1") block -mixin menu_switch_notable(id, title, enabled, checked, classes="") - td(class=`${classes}`) #{title}: - td(class=`${classes}` align="right") +mixin menu_switch_notable_gpio(channel, title, confirm_off="") + td #{title}: + td(align="right") + div(class="switch-box") + input(disabled type="checkbox" id=`gpio-switch-${channel}` class="gpio-switch" + data-channel=channel data-confirm-off=confirm_off) + label(for=`gpio-switch-${channel}`) + span(class="switch-inner") + span(class="switch") + +mixin menu_switch_notable(id, title, enabled, checked) + td #{title}: + td(align="right") div(class="switch-box") input(checked=checked disabled=!enabled type="checkbox" id=id) label(for=id)