mirror of
https://github.com/pi-hole/web.git
synced 2026-04-26 11:50:09 +01:00
Merge branch 'devel' into folderStructure
This commit is contained in:
@@ -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']))
|
||||
@@ -57,9 +58,12 @@
|
||||
if(count($data) > 0)
|
||||
{
|
||||
foreach ($data as $line) {
|
||||
list($key, $val) = explode(":", $line);
|
||||
// remove " kB" fron the end of the string and make an integer
|
||||
$meminfo[$key] = intVal(substr(trim($val),0, -3));
|
||||
$expl = explode(":", trim($line));
|
||||
if(count($expl) == 2)
|
||||
{
|
||||
// remove " kB" from the end of the string and make it an integer
|
||||
$meminfo[$expl[0]] = intVal(substr($expl[1],0, -3));
|
||||
}
|
||||
}
|
||||
$memory_used = $meminfo["MemTotal"]-$meminfo["MemFree"]-$meminfo["Buffers"]-$meminfo["Cached"];
|
||||
$memory_total = $meminfo["MemTotal"];
|
||||
@@ -261,13 +265,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>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user