mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
Adjust temperture display to use new FTL sensors.cpu_temp value
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -214,9 +214,9 @@ function updateSystemInfo() {
|
||||
var color;
|
||||
color = percentRAM > 75 ? "text-red" : "text-green-light";
|
||||
$("#memory").html(
|
||||
'<i class="fa fa-circle ' +
|
||||
'<i class="fa fa-fw fa-circle ' +
|
||||
color +
|
||||
'"></i> Memory usage: ' +
|
||||
'"></i> 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(
|
||||
'<i class="fa fa-circle ' +
|
||||
'<i class="fa fa-fw fa-circle ' +
|
||||
color +
|
||||
'"></i> CPU: ' +
|
||||
'"></i> 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('<i class="fa fa-fire ' + color + '"></i> Temp: ' + temp);
|
||||
} else $("#temperature").html('<i class="fa fa-fire"></i> 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('<i class="fa fa-fw fas ' + color + '"></i> Temp: ' + temp);
|
||||
} else $("#temperature").html('<i class="fa fa-fw fas fa-temperature-low"></i> Temp: N/A');
|
||||
// Update every 20 seconds
|
||||
clearTimeout(sensorsTimer);
|
||||
sensorsTimer = setTimeout(updateSensorsInfo, 20000);
|
||||
|
||||
Reference in New Issue
Block a user