mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 18:59:48 +01:00
Add per-browser temp unit selection
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -49,22 +49,6 @@
|
||||
$celsius *= 1e-3;
|
||||
}
|
||||
|
||||
$kelvin = $celsius + 273.15;
|
||||
$fahrenheit = ($celsius*9./5)+32.0;
|
||||
|
||||
if(isset($setupVars['TEMPERATUREUNIT']))
|
||||
{
|
||||
$temperatureunit = $setupVars['TEMPERATUREUNIT'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$temperatureunit = "C";
|
||||
}
|
||||
// Override temperature unit setting if it is changed via Settings page
|
||||
if(isset($_POST["tempunit"]))
|
||||
{
|
||||
$temperatureunit = $_POST["tempunit"];
|
||||
}
|
||||
// Get user-defined temperature limit if set
|
||||
if(isset($setupVars['TEMPERATURE_LIMIT']))
|
||||
{
|
||||
@@ -326,20 +310,7 @@ if($auth) {
|
||||
{
|
||||
echo "text-vivid-blue";
|
||||
}
|
||||
echo "\"></i> Temp: ";
|
||||
if($temperatureunit === "F")
|
||||
{
|
||||
echo round($fahrenheit,1) . " °F";
|
||||
}
|
||||
elseif($temperatureunit === "K")
|
||||
{
|
||||
echo round($kelvin,1) . " K";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo round($celsius,1) . " °C";
|
||||
}
|
||||
echo "</span>";
|
||||
?>"\"></i> Temp: <span id="rawtemp" hidden><?php echo $celsius;?></span><span id="tempdisplay"></span><?php
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user