mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Add Kelvin
This commit is contained in:
+8
-3
@@ -22,6 +22,7 @@
|
||||
if(is_numeric($output))
|
||||
{
|
||||
$celsius = intVal($output)*1e-3;
|
||||
$kelvin = $celsius + 273.15;
|
||||
$fahrenheit = ($celsius*9./5)+32.0;
|
||||
|
||||
if(isset($setupVars['TEMPERATUREUNIT']))
|
||||
@@ -261,13 +262,17 @@
|
||||
echo "#3366FF";
|
||||
}
|
||||
echo "\"></i> Temp: ";
|
||||
if($temperatureunit != "F")
|
||||
if($temperatureunit === "F")
|
||||
{
|
||||
echo round($celsius,1) . "°C";
|
||||
echo round($fahrenheit,1) . "°F";
|
||||
}
|
||||
elseif($temperatureunit === "K")
|
||||
{
|
||||
echo round($kelvin,1) . "K";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo round($fahrenheit,1) . "°F";
|
||||
echo round($celsius,1) . "°C";
|
||||
}
|
||||
echo "</a>";
|
||||
}
|
||||
|
||||
@@ -222,12 +222,14 @@ function validDomain($domain_name)
|
||||
if($_POST["tempunit"] == "F")
|
||||
{
|
||||
exec('sudo pihole -a -f');
|
||||
$success .= "The webUI settings have been updated";
|
||||
}
|
||||
elseif($_POST["tempunit"] == "K")
|
||||
{
|
||||
exec('sudo pihole -a -k');
|
||||
}
|
||||
else
|
||||
{
|
||||
exec('sudo pihole -a -c');
|
||||
$success .= "The webUI settings have been updated";
|
||||
}
|
||||
if(isset($_POST["boxedlayout"]))
|
||||
{
|
||||
@@ -237,6 +239,7 @@ function validDomain($domain_name)
|
||||
{
|
||||
exec('sudo pihole -a layout traditional');
|
||||
}
|
||||
$success .= "The webUI settings have been updated";
|
||||
break;
|
||||
|
||||
case "reboot":
|
||||
|
||||
@@ -452,6 +452,7 @@
|
||||
<h4>CPU Temperature Unit</h4>
|
||||
<div class="form-group">
|
||||
<div class="radio"><label><input type="radio" name="tempunit" value="C" <?php if($temperatureunit === "C"){ ?>checked<?php } ?> >Celsius</label></div>
|
||||
<div class="radio"><label><input type="radio" name="tempunit" value="K" <?php if($temperatureunit === "K"){ ?>checked<?php } ?> >Kelvin</label></div>
|
||||
<div class="radio"><label><input type="radio" name="tempunit" value="F" <?php if($temperatureunit === "F"){ ?>checked<?php } ?> >Fahrenheit</label></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user