mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 10:19:47 +01:00
Rework the temp info in the status panel (#2054)
* Explicit set templimit if no tempsensor output was found Signed-off-by: Christian König <ckoenig@posteo.de> * Only show Temp info if tempsensor data is available Signed-off-by: Christian König <ckoenig@posteo.de> * Move block to the right place Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -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) {
|
||||
?>
|
||||
<br/>
|
||||
<?php
|
||||
$tempcolor = "text-vivid-blue";
|
||||
if ($celsius > $temperaturelimit) {
|
||||
$tempcolor = "text-red";
|
||||
}
|
||||
echo '<span id="temperature"><i class="fa fa-w fa-fire '.$tempcolor.'" style="width: 1em !important"></i> ';
|
||||
|
||||
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 '<span id="temperature"><i class="fa fa-w fa-fire '.$tempcolor.'" style="width: 1em !important"></i> ';
|
||||
echo 'Temp: <span id="rawtemp" hidden>' .$celsius. '</span>';
|
||||
} else {
|
||||
echo "No temp sensor found";
|
||||
}
|
||||
echo '<span id="tempdisplay"></span></span>';
|
||||
echo '<span id="tempdisplay"></span></span>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user