From fc038d8400ffec73d951610c75a23040ae3d39fc Mon Sep 17 00:00:00 2001 From: Peuuuur-Noel Date: Tue, 25 Jul 2023 20:24:30 +0000 Subject: [PATCH] fix: tooltip on "Small" footer style --- .../emhttp/plugins/nut/include/nut_footer.php | 14 +++++++------- .../usr/local/emhttp/plugins/nut/nutFooter.page | 12 ++++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/nut/usr/local/emhttp/plugins/nut/include/nut_footer.php b/source/nut/usr/local/emhttp/plugins/nut/include/nut_footer.php index d3183434..6439f634 100644 --- a/source/nut/usr/local/emhttp/plugins/nut/include/nut_footer.php +++ b/source/nut/usr/local/emhttp/plugins/nut/include/nut_footer.php @@ -79,10 +79,10 @@ function format_time($seconds) { if ($battery !== false) { $battery_runtime = array_key_exists($nut_runtime, $ups_status) ? format_time($ups_status[$nut_runtime]) : "n/a"; - if ($online && $battery < 100) $icon = " {$battery} %"; - else if ($online && $battery == 100) $icon = " {$battery} %"; - else if (!$online) $icon = " {$battery} %"; - else $icon = "n/a"; + if ($online && $battery < 100) $icon = " {$battery} %"; + else if ($online && $battery == 100) $icon = " {$battery} %"; + else if (!$online) $icon = " {$battery} %"; + else $icon = "n/a"; $status[0] = $icon; } else { @@ -99,11 +99,11 @@ function format_time($seconds) { $realPower = $realPowerNominal && $load ? round($realPowerNominal * $load * 0.01) : -1; if ($realPower >= 0 && $apparentPower >= 0) { - $status[1] = " {$realPower} W ({$apparentPower} VA)"; + $status[1] = " {$realPower} W ({$apparentPower} VA)"; } else if ($realPower >= 0 && $load) { - $status[1] = " {$realPower} W"; + $status[1] = " {$realPower} W"; } else if ($apparentPower >= 0){ - $status[1] = " {$apparentPower} VA"; + $status[1] = " {$apparentPower} VA"; } echo "".implode('', $status).""; diff --git a/source/nut/usr/local/emhttp/plugins/nut/nutFooter.page b/source/nut/usr/local/emhttp/plugins/nut/nutFooter.page index 09c48c2d..762b8dde 100644 --- a/source/nut/usr/local/emhttp/plugins/nut/nutFooter.page +++ b/source/nut/usr/local/emhttp/plugins/nut/nutFooter.page @@ -40,6 +40,7 @@ EOT; ?> +