Removed changing of CPU temperature unit from Help Center

This commit is contained in:
DL6ER
2016-12-12 13:17:37 +01:00
parent 68a35091a8
commit f01c441783
2 changed files with 1 additions and 29 deletions
-15
View File
@@ -4,26 +4,11 @@
check_cors();
// Web based change of temperature unit
if (isset($_GET['tempunit']))
{
if($_GET['tempunit'] == "fahrenheit")
{
exec('sudo pihole -a -f');
}
else
{
exec('sudo pihole -a -c');
}
}
$cmd = "echo $((`cat /sys/class/thermal/thermal_zone0/temp | cut -c1-2`))";
$output = shell_exec($cmd);
$celsius = str_replace(array("\r\n","\r","\n"),"", $output);
$fahrenheit = round(str_replace(["\r\n","\r","\n"],"", $output*9./5)+32);
// Reparse setupVars.conf here, as we might have switched temperature units above
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
if(isset($setupVars['TEMPERATUREUNIT']))
{
$temperatureunit = $setupVars['TEMPERATUREUNIT'];
+1 -14
View File
@@ -19,20 +19,7 @@
<p>Shows different status messages:</p>
<ul>
<li>Status: Current status of the Pi-hole - Active (<i class="fa fa-circle" style="color:#7FFF00"></i>), Offline (<i class="fa fa-circle" style="color:#FF0000"></i>), or Starting (<i class="fa fa-circle" style="color:#ff9900"></i>)</li>
<li>Temp: Current CPU temperature
<?php
if($temperatureunit != "F"){
?>
(switch unit to <a href="help.php?tempunit=fahrenheit">Fahrenheit</a>)
<?php
}
else
{
?>
(switch unit to <a href="help.php?tempunit=celsius">Celsius</a>)
<?php
}
?></li>
<li>Temp: Current CPU temperature</li>
<li>Load: load averages for the last minute, 5 minutes and 15 minutes, respectively. A load average of 1 reflects the full workload of a single processor on the system. We show a red icon if the current load exceeds the number of available processors on this machine (which is <?php echo $nproc; ?>)</li>
<li>Memory usage: Shows the percentage of memory actually blocked by applications. We show a red icon if the memory usage exceeds 75%</li>
</ul>