diff options
author | Devaev Maxim <[email protected]> | 2020-07-11 03:01:24 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-07-11 03:01:24 +0300 |
commit | 2512c6448c76a2a78dfdf96852f57e8c643b5f35 (patch) | |
tree | 20c5cff14aa7a5cc51883044511c405064582f03 /web/share/js/kvm/session.js | |
parent | 01fee4992bdc1a464a68ef10f7faf68bbba05a38 (diff) |
notify about health
Diffstat (limited to 'web/share/js/kvm/session.js')
-rw-r--r-- | web/share/js/kvm/session.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js index ec7a34bd..72b68151 100644 --- a/web/share/js/kvm/session.js +++ b/web/share/js/kvm/session.js @@ -86,6 +86,18 @@ export function Session() { Throttling: ${__formatThrottling(state.health.throttling)} `; + + 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); + + tools.setHiddenVisible($("hw-health-dropdown"), (undervoltage || freq_capped)); + $("hw-health-undervoltage-led").className = (undervoltage ? (flags.undervoltage.now ? "led-red" : "led-yellow") : "hidden"); + $("hw-health-overheating-led").className = (freq_capped ? (flags.freq_capped.now ? "led-red" : "led-yellow") : "hidden"); + tools.setHiddenVisible($("hw-health-message-undervoltage"), undervoltage); + tools.setHiddenVisible($("hw-health-message-overheating"), freq_capped); + } }; var __formatTemp = function(temp) { |