From 33755f1775db31bc5cd5de0f8d82fa10a000bd42 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Sat, 8 Jan 2022 06:39:52 +0100 Subject: [PATCH] Rework the temp info in the status panel (#2054) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Explicit set templimit if no tempsensor output was found Signed-off-by: Christian König * Only show Temp info if tempsensor data is available Signed-off-by: Christian König * Move block to the right place Signed-off-by: Christian König --- scripts/pi-hole/php/header.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index 175fd41f..b3d783c9 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -66,6 +66,8 @@ // Nothing can be colder than -273.15 degree Celsius (= 0 Kelvin) // This is the minimum temperature possible (AKA absolute zero) $celsius = -273.16; + // Set templimit to null if no tempsensor was found + $temperaturelimit = null; } // Get load @@ -375,18 +377,16 @@ if($auth) { ?>
$temperaturelimit) { - $tempcolor = "text-red"; - } - echo ' '; - - if ($celsius >= -273.15) { + if ($celsius >= -273.15) { + // Only show temp info if any data is available --> + $tempcolor = "text-vivid-blue"; + if (isset($temperaturelimit) && $celsius > $temperaturelimit) { + $tempcolor = "text-red"; + } + echo ' '; echo 'Temp: '; - } else { - echo "No temp sensor found"; - } - echo ''; + echo ''; + } ?>