mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Removed changing of CPU temperature unit from Help Center
This commit is contained in:
-15
@@ -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'];
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user