mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
switch update notification
This commit is contained in:
parent
b49107ff6c
commit
965e649f8c
@ -49,6 +49,8 @@ class _UnitInfo:
|
|||||||
|
|
||||||
# =====
|
# =====
|
||||||
class StateCache: # pylint: disable=too-many-instance-attributes
|
class StateCache: # pylint: disable=too-many-instance-attributes
|
||||||
|
__FW_VERSION = 5
|
||||||
|
|
||||||
__FULL = 0xFFFF
|
__FULL = 0xFFFF
|
||||||
__SUMMARY = 0x01
|
__SUMMARY = 0x01
|
||||||
__EDIDS = 0x02
|
__EDIDS = 0x02
|
||||||
@ -139,6 +141,7 @@ class StateCache: # pylint: disable=too-many-instance-attributes
|
|||||||
state: dict = {}
|
state: dict = {}
|
||||||
if x_model:
|
if x_model:
|
||||||
state["model"] = {
|
state["model"] = {
|
||||||
|
"firmware": {"version": self.__FW_VERSION},
|
||||||
"units": [],
|
"units": [],
|
||||||
"ports": [],
|
"ports": [],
|
||||||
"limits": {
|
"limits": {
|
||||||
|
|||||||
@ -904,6 +904,20 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<hr>
|
<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">
|
<table class="kv">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ask ATX click confirmation:</td>
|
<td>Ask ATX click confirmation:</td>
|
||||||
|
|||||||
@ -14,6 +14,10 @@ li(id="switch-dropdown" class="right feature-disabled")
|
|||||||
div(class="text")
|
div(class="text")
|
||||||
button(data-force-hide-menu data-show-window="switch-window" class="small") • Settings
|
button(data-force-hide-menu data-show-window="switch-window" class="small") • Settings
|
||||||
hr
|
hr
|
||||||
|
div(id="switch-message-update" class="hidden")
|
||||||
|
+menu_message("info", "Good news! Your switch is ready to get the firmware update")
|
||||||
|
| Please #[a(target="_blank" href="https://docs.pikvm.org/switch/#firmware-updating") follow the instructions] when you decide to install it.
|
||||||
|
hr
|
||||||
+menu_switch("switch-atx-ask-switch", "Ask ATX click confirmation", true, true)
|
+menu_switch("switch-atx-ask-switch", "Ask ATX click confirmation", true, true)
|
||||||
hr
|
hr
|
||||||
table(id="switch-chain" class="kv")
|
table(id="switch-chain" class="kv")
|
||||||
|
|||||||
@ -406,6 +406,10 @@ export function Switch() {
|
|||||||
}
|
}
|
||||||
$("switch-chain").innerHTML = content;
|
$("switch-chain").innerHTML = content;
|
||||||
|
|
||||||
|
if (model.units.length > 0) {
|
||||||
|
tools.hidden.setVisible($("switch-message-update"), (model.firmware.version > model.units[0].firmware.version));
|
||||||
|
}
|
||||||
|
|
||||||
for (let unit = 0; unit < model.units.length; ++unit) {
|
for (let unit = 0; unit < model.units.length; ++unit) {
|
||||||
tools.el.setOnClick($(`__switch-beacon-button-u${unit}`), tools.partial(__switchUplinkBeacon, unit));
|
tools.el.setOnClick($(`__switch-beacon-button-u${unit}`), tools.partial(__switchUplinkBeacon, unit));
|
||||||
tools.el.setOnClick($(`__switch-beacon-button-d${unit}`), tools.partial(__switchDownlinkBeacon, unit));
|
tools.el.setOnClick($(`__switch-beacon-button-d${unit}`), tools.partial(__switchDownlinkBeacon, unit));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user