notify about health

This commit is contained in:
Devaev Maxim
2020-07-11 03:01:24 +03:00
parent 01fee4992b
commit 2512c6448c
5 changed files with 204 additions and 2 deletions

View File

@@ -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) {