Fixed: Dashboard: show heat alarm per pool

This commit is contained in:
bergware
2023-02-10 14:37:26 +01:00
parent 70b99711a0
commit 9fbd892952

View File

@@ -159,8 +159,8 @@ function device_temp(&$disk, &$red, &$orange) {
global $display;
$spin = strpos($disk['color'],'blink')===false;
$temp = $disk['temp'];
$hot = $disk['hotTemp'] ?? $display['hot'];
$max = $disk['maxTemp'] ?? $display['max'];
$hot = $disk['hotTemp'] ?? $display['hot'] ?? 0;
$max = $disk['maxTemp'] ?? $display['max'] ?? 0;
$top = $display['top'] ?? 120;
$heat = false; $color = 'green';
if (exceed($temp,$max,$top)) {
@@ -299,9 +299,9 @@ while (true) {
$echo[0] .= array_group('Data');
$echo[0] .= "\0".($error+$warning)."\0".($red+$orange)."\0".($fail+$smart)."\0".($full+$high);
//pool devices
$error = $warning = $red = $orange = $fail = $smart = $full = $high = 0;
$echo[1] = '';
foreach (pools_filter($disks) as $pool) if ($disks[$pool]['devices']) {
$error = $warning = $red = $orange = $fail = $smart = $full = $high = 0;
$echo[1] .= array_group('Cache',$pool);
$echo[1] .= "\0".($error+$warning)."\0".($red+$orange)."\0".($fail+$smart)."\0".($full+$high)."\r";
}