From 9819c6a3e1c9c8bedf59da3966eb34b6a534a0bc Mon Sep 17 00:00:00 2001 From: Weylin-fr Date: Mon, 20 Jan 2020 16:30:44 +0100 Subject: [PATCH] Update system.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adding the CPU temp from a copy of CPU load. - The CPU temp cannot go to 100°C, so i multiply the temp to 1.2. This way the progress bar is full when CPU temp is 83°C or more. - The LAN Chipset supports up to 70°C, so i set the red progress bar to that threshold (source: https://www.raspberrypi.org/documentation/faqs/) --- templates/system.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/templates/system.php b/templates/system.php index c48befce..b50947ac 100755 --- a/templates/system.php +++ b/templates/system.php @@ -25,6 +25,16 @@ if ($cpuload > 90) { $cpuload_status = "success"; } +// cpu temp +$cputemp = $system->systemTemperature(); +if ($cputemp > 70) { + $cputemp_status = "danger"; +} elseif ($cputemp > 50) { + $cputemp_status = "warning"; +} else { + $cputemp_status = "success"; +} + ?>
@@ -63,12 +73,20 @@ if ($cpuload > 90) {
-
+
%
+
+
+
+
°C +
+