diff options
author | Maxim Devaev <[email protected]> | 2023-09-10 14:54:21 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-09-10 14:54:25 +0300 |
commit | cec03c4468df87bcdc68f20c2cf51a7998c56ebd (patch) | |
tree | 17df2d093adcb74d2c8cda905cac8453122082d0 /web | |
parent | 7900a243a298df7e211aa2ba68db49b998396bc3 (diff) |
mute false-positive underpower on cm4-based (v4) devices
Diffstat (limited to 'web')
-rw-r--r-- | web/share/js/kvm/session.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js index aed82325..7168aeae 100644 --- a/web/share/js/kvm/session.js +++ b/web/share/js/kvm/session.js @@ -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 { |