From d18c27744f5a076683c0101f14a8ce5a0ac4b671 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 19 May 2021 10:06:50 +0300 Subject: [PATCH] common table for switches --- web/kvm/index.html | 76 +++++++++++++++++++-------------------- web/kvm/navbar-system.pug | 21 +++++------ web/kvm/navbar.pug | 18 ++++++---- 3 files changed, 56 insertions(+), 59 deletions(-) diff --git a/web/kvm/index.html b/web/kvm/index.html index 7f1e1932..5c580c6f 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -182,9 +182,8 @@ -
-
- +
+ -
Squash relative mouse moves:
@@ -192,11 +191,8 @@
-
-
-
- + + -
Connect HID to Server:
@@ -204,21 +200,17 @@
-
-
- - - -
Mute HID input events: -
- - -
-
-
-
- + + + + + + -
Mute HID input events: +
+ + +
+
Connect main USB to Server:
@@ -226,9 +218,9 @@
-
-
+ + +
@@ -435,13 +427,15 @@
- - + + + +
Infinite loop playback: -
- - -
-
Infinite loop playback: +
+ + +
+

@@ -472,13 +466,15 @@
- - + + + +
Ask paste confirmation: -
- - -
-
Ask paste confirmation: +
+ + +
+

diff --git a/web/kvm/navbar-system.pug b/web/kvm/navbar-system.pug index 7548852f..3d32c260 100644 --- a/web/kvm/navbar-system.pug +++ b/web/kvm/navbar-system.pug @@ -48,17 +48,14 @@ li(class="right") tr td Mouse: td #[div(id="hid-outputs-mouse" class="radio-box")] - div(id="hid-mouse-squash" class="feature-disabled") - hr - +menu_switch("hid-mouse-squash-switch", "Squash relative mouse moves", true, true) - div(id="hid-connect" class="feature-disabled") - hr - +menu_switch("hid-connect-switch", "Connect HID to Server", true, true) - hr - +menu_switch("hid-mute-switch", "Mute HID input events", true, false) - hr - div(id="v3-usb-breaker" class="feature-disabled") - table(class="kv") + table(class="kv") + tr(id="hid-mouse-squash" class="feature-disabled") + +menu_switch_notable("hid-mouse-squash-switch", "Squash relative mouse moves", true, true) + tr(id="hid-connect" class="feature-disabled") + +menu_switch_notable("hid-connect-switch", "Connect HID to Server", true, true) + 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") @@ -69,7 +66,7 @@ li(class="right") label(for="gpio-switch-__v3_usb_breaker__") span(class="switch-inner") span(class="switch") - hr + 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/kvm/navbar.pug b/web/kvm/navbar.pug index d345f1dd..c86d5cb6 100644 --- a/web/kvm/navbar.pug +++ b/web/kvm/navbar.pug @@ -13,15 +13,19 @@ mixin menu_message(icon, short, classes="") sup(style="line-height:1") block +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) + span(class="switch-inner") + span(class="switch") + mixin menu_switch(id, title, enabled, checked) table(class="kv") - td #{title}: - td(align="right") - div(class="switch-box") - input(checked=checked disabled=!enabled type="checkbox" id=id) - label(for=id) - span(class="switch-inner") - span(class="switch") + tr + +menu_switch_notable(id, title, enabled, checked) ul(id="navbar") li(class="left")