From eeceea6d101625ca6358fb186e93f059deaa14b6 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 9 Feb 2023 18:16:14 +0100 Subject: [PATCH] Adjust temperture display to use new FTL sensors.cpu_temp value Signed-off-by: DL6ER --- scripts/pi-hole/js/footer.js | 18 +++++++++--------- settings.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index d8b77992..f0df3d52 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -214,9 +214,9 @@ function updateSystemInfo() { var color; color = percentRAM > 75 ? "text-red" : "text-green-light"; $("#memory").html( - ' Memory usage: ' + + '">  Memory usage: ' + percentRAM.toFixed(1) + " %" ); @@ -237,9 +237,9 @@ function updateSystemInfo() { color = system.cpu.load.percent[0] > 100 ? "text-red" : "text-green-light"; $("#cpu").html( - ' CPU: ' + + '">  CPU: ' + system.cpu.load.percent[0].toFixed(1) + " %" ); @@ -301,11 +301,11 @@ function updateSensorsInfo() { url: "/api/info/sensors", }) .done(function (data) { - if (data.sensors.length > 0) { - var temp = data.sensors[0].value.toFixed(1) + " °C"; - var color = data.sensors[0].value > 50 ? "text-red" : "text-vivid-blue"; - $("#temperature").html(' Temp: ' + temp); - } else $("#temperature").html(' Temp: N/A'); + if (data.sensors.cpu_temp !== null) { + var temp = data.sensors.cpu_temp.toFixed(1) + " °C"; + var color = data.sensors.cpu_temp > data.sensors.hot_limit ? "text-red fa-temperature-high" : "text-green-light fa-temperature-low"; + $("#temperature").html(' Temp: ' + temp); + } else $("#temperature").html(' Temp: N/A'); // Update every 20 seconds clearTimeout(sensorsTimer); sensorsTimer = setTimeout(updateSensorsInfo, 20000); diff --git a/settings.php b/settings.php index 4b06afed..6d266261 100644 --- a/settings.php +++ b/settings.php @@ -577,7 +577,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array('sysadmin', 'dns', 'dhcp autocorrect="off" id="dhcp.leaseTime" value=""> -

The lease time can be in seconds, or minutes (e.g., "45m") or hours (e.g., "1h") or days (like "2d") or even weeks ("1w"). You may also use "infinite" as string but be aware of the drawbacks.

+

The lease time can be in seconds, or minutes (e.g., "45m") or hours (e.g., "1h") or days (like "2d") or even weeks ("1w"). You may also use "infinite" as string but be aware of the drawbacks (assigned addresses are will only be made available again after the lease time has passed).