mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
mute false-positive underpower on cm4-based (v4) devices
This commit is contained in:
parent
7900a243a2
commit
cec03c4468
@ -10,6 +10,8 @@ kvmd:
|
||||
auth: !include auth.yaml
|
||||
|
||||
info:
|
||||
hw:
|
||||
ignore_past: true
|
||||
fan:
|
||||
unix: /run/kvmd/fan.sock
|
||||
|
||||
|
||||
@ -10,6 +10,8 @@ kvmd:
|
||||
auth: !include auth.yaml
|
||||
|
||||
info:
|
||||
hw:
|
||||
ignore_past: true
|
||||
fan:
|
||||
unix: /run/kvmd/fan.sock
|
||||
|
||||
|
||||
@ -383,6 +383,7 @@ def _get_config_scheme() -> dict:
|
||||
"extras": Option("/usr/share/kvmd/extras", type=valid_abs_dir),
|
||||
"hw": {
|
||||
"vcgencmd_cmd": Option(["/opt/vc/bin/vcgencmd"], type=valid_command),
|
||||
"ignore_past": Option(False, type=valid_bool),
|
||||
"state_poll": Option(10.0, type=valid_float_f01),
|
||||
},
|
||||
"fan": {
|
||||
|
||||
@ -46,10 +46,12 @@ class HwInfoSubmanager(BaseInfoSubmanager):
|
||||
def __init__(
|
||||
self,
|
||||
vcgencmd_cmd: list[str],
|
||||
ignore_past: bool,
|
||||
state_poll: float,
|
||||
) -> None:
|
||||
|
||||
self.__vcgencmd_cmd = vcgencmd_cmd
|
||||
self.__ignore_past = ignore_past
|
||||
self.__state_poll = state_poll
|
||||
|
||||
self.__dt_cache: dict[str, str] = {}
|
||||
@ -127,6 +129,7 @@ class HwInfoSubmanager(BaseInfoSubmanager):
|
||||
"past": bool(flags & (1 << 18)),
|
||||
},
|
||||
},
|
||||
"ignore_past": self.__ignore_past,
|
||||
}
|
||||
return None
|
||||
|
||||
|
||||
@ -91,8 +91,9 @@ export function Session() {
|
||||
var __setAboutInfoHw = function(state) {
|
||||
if (state.health.throttling !== null) {
|
||||
let flags = state.health.throttling.parsed_flags;
|
||||
let undervoltage = (flags.undervoltage.now || flags.undervoltage.past);
|
||||
let freq_capped = (flags.freq_capped.now || flags.freq_capped.past);
|
||||
let ignore_past = state.health.throttling.ignore_past;
|
||||
let undervoltage = (flags.undervoltage.now || (flags.undervoltage.past && !ignore_past));
|
||||
let freq_capped = (flags.freq_capped.now || (flags.freq_capped.past && !ignore_past));
|
||||
|
||||
tools.hidden.setVisible($("hw-health-dropdown"), (undervoltage || freq_capped));
|
||||
$("hw-health-undervoltage-led").className = (undervoltage ? (flags.undervoltage.now ? "led-red" : "led-yellow") : "hidden");
|
||||
@ -188,12 +189,12 @@ export function Session() {
|
||||
let pairs = [];
|
||||
for (let field of Object.keys(throttling.parsed_flags).sort()) {
|
||||
let flags = throttling.parsed_flags[field];
|
||||
pairs.push([
|
||||
tools.upperFirst(field).replace("_", " "),
|
||||
(flags["now"] ? __colored("red", "RIGHT NOW") : __colored("green", "No"))
|
||||
+ "; " +
|
||||
(flags["past"] ? __colored("red", "In the past") : __colored("green", "Never")),
|
||||
]);
|
||||
let key = tools.upperFirst(field).replace("_", " ");
|
||||
let value = (flags["now"] ? __colored("red", "RIGHT NOW") : __colored("green", "No"));
|
||||
if (!throttling.ignore_past) {
|
||||
value += "; " + (flags["past"] ? __colored("red", "In the past") : __colored("green", "Never"));
|
||||
}
|
||||
pairs.push([key, value]);
|
||||
}
|
||||
return __formatUl(pairs);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user