mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
Add support for PiKVM Switch and related features
This commit introduces several new components and improvements: - Added Switch module with firmware update and configuration support - Implemented new media streaming capabilities - Updated various UI elements and CSS styles - Enhanced keyboard and mouse event handling - Added new validators and configuration options - Updated Python version support to 3.13 - Improved error handling and logging
This commit is contained in:
@@ -142,7 +142,7 @@
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<li class="right" id="system-dropdown"><a class="menu-button" href="#"><img class="led-gray" id="link-led" src="/share/svg/led-link.svg"><img class="led-gray" id="stream-led" src="/share/svg/led-stream.svg"><img class="led-gray" id="hid-keyboard-led" src="/share/svg/led-hid-keyboard.svg"><img class="led-gray" id="hid-mouse-led" src="/share/svg/led-hid-mouse.svg"><span i18n="kvm_text3">System</span></a>
|
||||
<li class="right" id="system-dropdown"><a class="menu-button" href="#"><img class="led-gray" id="link-led" src="/share/svg/led-link.svg"><img class="led-gray" id="stream-led" src="/share/svg/led-video.svg"><img class="led-gray" id="hid-keyboard-led" src="/share/svg/led-hid-keyboard.svg"><img class="led-gray" id="hid-mouse-led" src="/share/svg/led-hid-mouse.svg"><span>System</span></a>
|
||||
<div class="menu" id="system-menu">
|
||||
<table class="kv">
|
||||
<tr>
|
||||
@@ -173,6 +173,17 @@
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="hidden" id="stream-message-no-vd">
|
||||
<div class="text">
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="2"><img class="sign " src="/share/svg/warning.svg"></td>
|
||||
<td style="line-height:1.5"><b>Direct HTTP H.264 streaming is not supported</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="hidden" id="stream-message-no-h264">
|
||||
<div class="text">
|
||||
<table>
|
||||
@@ -223,10 +234,12 @@
|
||||
<td i18n="kvm_text14">Video <a target="_blank" href="https://docs.pikvm.org/webrtc">mode</a>:</td>
|
||||
<td>
|
||||
<div class="radio-box">
|
||||
<input checked type="radio" id="stream-mode-radio-mjpeg" name="stream-mode-radio" value="mjpeg">
|
||||
<label for="stream-mode-radio-mjpeg">MJPEG / HTTP</label>
|
||||
<input type="radio" id="stream-mode-radio-janus" name="stream-mode-radio" value="janus">
|
||||
<label for="stream-mode-radio-janus">H.264 / WebRTC</label>
|
||||
<label for="stream-mode-radio-janus">WebRTC</label>
|
||||
<input type="radio" id="stream-mode-radio-media" name="stream-mode-radio" value="media">
|
||||
<label for="stream-mode-radio-media">H.264</label>
|
||||
<input checked type="radio" id="stream-mode-radio-mjpeg" name="stream-mode-radio" value="mjpeg">
|
||||
<label for="stream-mode-radio-mjpeg">MJPEG</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -252,6 +265,15 @@
|
||||
</td>
|
||||
<td class="value-number" id="stream-audio-volume-value"></td>
|
||||
</tr>
|
||||
<tr class="feature-disabled" id="stream-mic">
|
||||
<td>Microphone:</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input disabled type="checkbox" id="stream-mic-switch">
|
||||
<label for="stream-mic-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="buttons buttons-row">
|
||||
@@ -280,6 +302,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
<details>
|
||||
<summary>Keyboard & mouse (HID) settings</summary>
|
||||
<summary i18n="kvm_text25">Keyboard & Mouse (HID) settings</summary>
|
||||
<div class="spoiler">
|
||||
<table class="kv">
|
||||
@@ -396,6 +419,15 @@
|
||||
</div>
|
||||
</details>
|
||||
<table class="kv">
|
||||
<tr>
|
||||
<td>Bad link mode (release keys immediately):</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input type="checkbox" id="hid-keyboard-bad-link-switch">
|
||||
<label for="hid-keyboard-bad-link-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="feature-disabled" id="hid-connect">
|
||||
<td i18n="hid-connect-switch">Connect HID to Server:</td>
|
||||
<td align="right">
|
||||
@@ -416,6 +448,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td i18n="hid-mute-switch">Mute HID input events:</td>
|
||||
<td>Mute all input HID events:</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input type="checkbox" id="hid-mute-switch">
|
||||
@@ -502,15 +535,15 @@
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="hidden" id="msd-message-too-big-for-cdrom">
|
||||
<div class="hidden" id="msd-message-too-big-for-dvd">
|
||||
<div class="text">
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="2"><img class="sign msd-message-too-big-for-cdrom" src="/share/svg/warning.svg"></td>
|
||||
<td rowspan="2"><img class="sign " src="/share/svg/warning.svg"></td>
|
||||
<td style="line-height:1.5"><b>Current image is too big for CD-ROM!</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><sup style="line-height:1">The device filesystem will be truncated to 2.2GiB</sup></td>
|
||||
<td><sup style="line-height:1">The maximum is 31.6GiB. Please switch to the Flash mode.</sup></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -580,7 +613,7 @@
|
||||
<td>
|
||||
<div class="radio-box">
|
||||
<input checked type="radio" id="msd-mode-radio-cdrom" name="msd-mode-radio" value="1">
|
||||
<label for="msd-mode-radio-cdrom">CD-ROM</label>
|
||||
<label for="msd-mode-radio-cdrom">CD/DVD</label>
|
||||
<input type="radio" id="msd-mode-radio-flash" name="msd-mode-radio" value="0">
|
||||
<label for="msd-mode-radio-flash">Flash</label>
|
||||
</div>
|
||||
@@ -754,16 +787,16 @@
|
||||
</table>
|
||||
<table class="kv">
|
||||
<tr>
|
||||
<td i18n="hid-pak-ask-switch">Ask paste confirmation:</td>
|
||||
<td>Slow typing:</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input checked type="checkbox" id="hid-pak-ask-switch">
|
||||
<label for="hid-pak-ask-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||
<input type="checkbox" id="hid-pak-slow-switch">
|
||||
<label for="hid-pak-slow-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="feature-disabled" id="hid-pak-secure">
|
||||
<td i18n="hid-pak-secure-switch">Hide input text:</td>
|
||||
<tr>
|
||||
<td>Hide input text:</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input type="checkbox" id="hid-pak-secure-switch">
|
||||
@@ -771,6 +804,15 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ask paste confirmation:</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input checked type="checkbox" id="hid-pak-ask-switch">
|
||||
<label for="hid-pak-ask-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="feature-disabled" id="stream-ocr">
|
||||
<hr><br>
|
||||
@@ -809,7 +851,7 @@
|
||||
<hr>
|
||||
<div class="buttons">
|
||||
<div class="buttons-row">
|
||||
<button class="row50" data-force-hide-menu data-shortcut="CapsLock">• Caps Lock <img class="inline-lamp hid-keyboard-caps-led led-gray" src="/share/svg/led-square.svg"></button>
|
||||
<button class="row50" data-force-hide-menu data-shortcut="CapsLock">• Caps Lock <img class="inline-lamp-small hid-keyboard-caps-led led-gray" src="/share/svg/led-square.svg"></button>
|
||||
<button class="row50" data-force-hide-menu data-shortcut="MetaLeft">• Left Win</button>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -884,6 +926,50 @@
|
||||
<li class="right feature-disabled" id="gpio-dropdown"><a class="menu-button" id="gpio-menu-button" href="#"><span>GPIO</span></a>
|
||||
<div class="menu" id="gpio-menu"></div>
|
||||
</li>
|
||||
<li class="right feature-disabled" id="switch-dropdown"><a class="menu-button" id="switch-menu-button" href="#"><img class="led-gray" id="switch-atx-power-led" src="/share/svg/led-atx-power.svg"><img class="led-gray" id="switch-atx-hdd-led" src="/share/svg/led-atx-hdd.svg"><span>Switch <i><sub id="switch-active-port"></sub></i></span></a>
|
||||
<div class="menu" id="switch-menu">
|
||||
<table style="border-spacing: 0px;">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="text"><b><a target="_blank" href="https://docs.pikvm.org/switch">PiKVM Switch</a> is attached<br></b><sub>Select a port or perform any available action like ATX click</sub></div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="text">
|
||||
<button class="small" data-force-hide-menu data-show-window="switch-window">• Settings</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="hidden" id="switch-message-update">
|
||||
<div class="text">
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan="2"><img class="sign " src="/share/svg/info.svg"></td>
|
||||
<td style="line-height:1.5"><b>Good news! Your switch is ready to get the firmware update</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><sup style="line-height:1">Please <a target="_blank" href="https://docs.pikvm.org/switch/#firmware-updating">follow the instructions</a> when you decide to install it.</sup></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<table class="kv">
|
||||
<tr>
|
||||
<td>Ask ATX click confirmation:</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input checked type="checkbox" id="switch-atx-ask-switch">
|
||||
<label for="switch-atx-ask-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<table class="kv" id="switch-chain"></table>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="window" id="stream-ocr-window">
|
||||
<div class="hidden" id="stream-ocr-selection"></div>
|
||||
@@ -901,6 +987,7 @@
|
||||
<button class="window-button-exit-full-tab">▼</button>
|
||||
<div class="stream-box-offline" id="stream-box"><img id="stream-image" src="/share/png/blank-stream.png">
|
||||
<video class="hidden" id="stream-video" disablePictureInPicture="true" autoplay playsinline muted></video>
|
||||
<canvas class="hidden" id="stream-canvas"></canvas>
|
||||
<div id="stream-fullscreen-active"></div>
|
||||
</div>
|
||||
<div class="keypad" id="stream-mouse-buttons" align="center">
|
||||
@@ -1168,7 +1255,7 @@
|
||||
</div>
|
||||
<div class="keypad-row">
|
||||
<div class="key wide-2 left small" data-code="CapsLock">
|
||||
<div class="label"><img class="inline-lamp hid-keyboard-caps-led led-gray" src="/share/svg/led-square.svg"><br> Caps Lock
|
||||
<div class="label"><img class="inline-lamp-small hid-keyboard-caps-led led-gray" src="/share/svg/led-square.svg"><br> Caps Lock
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
@@ -1343,7 +1430,7 @@
|
||||
</div>
|
||||
<div class="spacer-fixed"></div>
|
||||
<div class="key small" data-code="ScrollLock">
|
||||
<div class="label"><img class="inline-lamp hid-keyboard-scroll-led led-gray" src="/share/svg/led-square.svg"><br> ScrLk
|
||||
<div class="label"><img class="inline-lamp-small hid-keyboard-scroll-led led-gray" src="/share/svg/led-square.svg"><br> ScrLk
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer-fixed"></div>
|
||||
@@ -1439,7 +1526,7 @@
|
||||
<hr>
|
||||
<div class="keypad-row">
|
||||
<div class="key small" data-code="NumLock">
|
||||
<div class="label"><img class="inline-lamp hid-keyboard-num-led led-gray" src="/share/svg/led-square.svg"><br> NmLk
|
||||
<div class="label"><img class="inline-lamp-small hid-keyboard-num-led led-gray" src="/share/svg/led-square.svg"><br> NmLk
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer-fixed"></div>
|
||||
@@ -1645,7 +1732,7 @@
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div class="key small" data-code="ScrollLock">
|
||||
<div class="label"><img class="inline-lamp hid-keyboard-scroll-led led-gray" src="/share/svg/led-square.svg"><br> ScrLk
|
||||
<div class="label"><img class="inline-lamp-small hid-keyboard-scroll-led led-gray" src="/share/svg/led-square.svg"><br> ScrLk
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
@@ -1818,7 +1905,7 @@
|
||||
</div>
|
||||
<div class="keypad-row">
|
||||
<div class="key wide-2 left small" data-code="CapsLock">
|
||||
<div class="label"><img class="inline-lamp hid-keyboard-caps-led led-gray" src="/share/svg/led-square.svg"><br> Caps Lock
|
||||
<div class="label"><img class="inline-lamp-small hid-keyboard-caps-led led-gray" src="/share/svg/led-square.svg"><br> Caps Lock
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
@@ -2017,6 +2104,170 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="window" id="switch-window" style="width:min-content">
|
||||
<div class="window-header">
|
||||
<div class="window-grab">Switch settings</div>
|
||||
<button class="window-button-close"><b>×</b></button>
|
||||
</div>
|
||||
<div class="tabs-box">
|
||||
<input checked type="radio" name="switch-tab-button" id="switch-tab-edid-button">
|
||||
<label for="switch-tab-edid-button">EDIDs collection</label>
|
||||
<div class="tab">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<select id="switch-edid-selector" size="8"></select>
|
||||
</td>
|
||||
<td rowspan="2" style="vertical-align:top">
|
||||
<table class="kv">
|
||||
<tr>
|
||||
<td>Manufacturer:</td>
|
||||
<td class="value" id="switch-edid-info-mfc-id"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Product ID:</td>
|
||||
<td class="value" id="switch-edid-info-product-id"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serial:</td>
|
||||
<td class="value" id="switch-edid-info-serial"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Monitor name:</td>
|
||||
<td class="value" id="switch-edid-info-monitor-name"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Extra serial:</td>
|
||||
<td class="value" id="switch-edid-info-monitor-serial"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Audio enabled:</td>
|
||||
<td class="value" id="switch-edid-info-audio"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Data:</td>
|
||||
<td>
|
||||
<button class="small" disabled id="switch-edid-copy-data-button">Copy</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button id="switch-edid-add-button">Add new</button>
|
||||
</td>
|
||||
<td style="float:right">
|
||||
<button disabled id="switch-edid-remove-button">Remove</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<input type="radio" name="switch-tab-button" id="switch-tab-colors-button">
|
||||
<label for="switch-tab-colors-button">Color scheme</label>
|
||||
<div class="tab">
|
||||
<table>
|
||||
<!--tr
|
||||
td Role
|
||||
td Color
|
||||
td Brightness
|
||||
td
|
||||
td Reset
|
||||
-->
|
||||
<!--trtd
|
||||
<hr>
|
||||
td
|
||||
<hr>
|
||||
td
|
||||
<hr>
|
||||
td
|
||||
td
|
||||
<hr>
|
||||
-->
|
||||
<tr>
|
||||
<td style="white-space: nowrap">Selected port:</td>
|
||||
<td>
|
||||
<input type="color" id="switch-color-active-input">
|
||||
</td>
|
||||
<td>
|
||||
<input type="range" id="switch-color-active-brightness-slider" style="min-width:150px">
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<button class="small" id="switch-color-active-default-button" title="Reset default">↻</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="white-space: nowrap">Inactive port:</td>
|
||||
<td>
|
||||
<input type="color" id="switch-color-inactive-input">
|
||||
</td>
|
||||
<td>
|
||||
<input type="range" id="switch-color-inactive-brightness-slider" style="min-width:150px">
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<button class="small" id="switch-color-inactive-default-button" title="Reset default">↻</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="white-space: nowrap">Blinking beacon:</td>
|
||||
<td>
|
||||
<input type="color" id="switch-color-beacon-input">
|
||||
</td>
|
||||
<td>
|
||||
<input type="range" id="switch-color-beacon-brightness-slider" style="min-width:150px">
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<button class="small" id="switch-color-beacon-default-button" title="Reset default">↻</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<hr>
|
||||
</td>
|
||||
<td>
|
||||
<hr>
|
||||
</td>
|
||||
<td>
|
||||
<hr>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="white-space: nowrap">Flashing downlink:</td>
|
||||
<td>
|
||||
<input type="color" id="switch-color-flashing-input">
|
||||
</td>
|
||||
<td>
|
||||
<input type="range" id="switch-color-flashing-brightness-slider" style="min-width:150px">
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<button class="small" id="switch-color-flashing-default-button" title="Reset default">↻</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="white-space: nowrap">Bootloader mode:</td>
|
||||
<td>
|
||||
<input type="color" id="switch-color-bootloader-input">
|
||||
</td>
|
||||
<td>
|
||||
<input type="range" id="switch-color-bootloader-brightness-slider" style="min-width:150px">
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<button class="small" id="switch-color-bootloader-default-button" title="Reset default">↻</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="window" id="about-window">
|
||||
<div class="window-header">
|
||||
<div class="window-grab" i18n="kvm_text1">About</div>
|
||||
@@ -2102,6 +2353,7 @@
|
||||
<li>Alok Anand</li>
|
||||
<li>Alucard</li>
|
||||
<li>Ananthaneshan Elampoornan</li>
|
||||
<li>Andreas Grundler</li>
|
||||
<li>Andreas Marufke</li>
|
||||
<li>Andreas Schmid</li>
|
||||
<li>Andrew Brant</li>
|
||||
@@ -2162,6 +2414,7 @@
|
||||
<li>Brian T Mulcahy</li>
|
||||
<li>Brian Vecchiarelli</li>
|
||||
<li>Brian White</li>
|
||||
<li>brodonalds</li>
|
||||
<li>Bruno Gomes</li>
|
||||
<li>Bryan Adams</li>
|
||||
<li>Bryan Montgomery</li>
|
||||
@@ -2498,6 +2751,7 @@
|
||||
<li>Mikael Wikström</li>
|
||||
<li>Mike Mason</li>
|
||||
<li>Mikhael Mariano</li>
|
||||
<li>Milan Burda</li>
|
||||
<li>Milan Múčka</li>
|
||||
<li>Miles Davis</li>
|
||||
<li>Minh Tang</li>
|
||||
@@ -2516,6 +2770,7 @@
|
||||
<li>Nick Roethemeier</li>
|
||||
<li>Nico Baumgartner</li>
|
||||
<li>Nicolai Kragh-Hansen</li>
|
||||
<li>Nicolas Christener</li>
|
||||
<li>Nigel Smith</li>
|
||||
<li>Nihal Fernando</li>
|
||||
<li>Nils Orbat</li>
|
||||
@@ -2523,6 +2778,7 @@
|
||||
<li>Nithin Philips</li>
|
||||
<li>Nod Swal</li>
|
||||
<li>Nolan Haynes</li>
|
||||
<li>Noxigen LLC</li>
|
||||
<li>nubbn</li>
|
||||
<li>nybble</li>
|
||||
<li>Oh Be</li>
|
||||
@@ -2607,6 +2863,7 @@
|
||||
<li>Scuba</li>
|
||||
<li>Sean</li>
|
||||
<li>Sean Akers</li>
|
||||
<li>Sean c Rickard</li>
|
||||
<li>SEAT</li>
|
||||
<li>Sebastian</li>
|
||||
<li>Seonwoo Lee</li>
|
||||
@@ -2675,6 +2932,7 @@
|
||||
<li>Udo Schroeter</li>
|
||||
<li>Uli Fahrer</li>
|
||||
<li>Vasily Lazarev</li>
|
||||
<li>Venmo</li>
|
||||
<li>Vidru Eduard</li>
|
||||
<li>Vicente Salvador Cubedo</li>
|
||||
<li>Viktor Aschenbrenner</li>
|
||||
|
||||
Reference in New Issue
Block a user