Adjust temperture display to use new FTL sensors.cpu_temp value

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-02-09 18:16:14 +01:00
parent 444b4f4864
commit eeceea6d10
2 changed files with 10 additions and 10 deletions
+9 -9
View File
@@ -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>&nbsp;Memory usage:&nbsp;' +
'"></i>&nbsp;&nbsp;Memory usage:&nbsp;' +
percentRAM.toFixed(1) +
"&thinsp;%"
);
@@ -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>&nbsp;CPU:&nbsp;' +
'"></i>&nbsp;&nbsp;CPU:&nbsp;' +
system.cpu.load.percent[0].toFixed(1) +
"&thinsp;%"
);
@@ -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) + "&thinsp;&deg;C";
var color = data.sensors[0].value > 50 ? "text-red" : "text-vivid-blue";
$("#temperature").html('<i class="fa fa-fire ' + color + '"></i>&nbsp;Temp:&nbsp;' + temp);
} else $("#temperature").html('<i class="fa fa-fire"></i>&nbsp;Temp:&nbsp;N/A');
if (data.sensors.cpu_temp !== null) {
var temp = data.sensors.cpu_temp.toFixed(1) + "&thinsp;&deg;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>&nbsp;Temp:&nbsp;' + temp);
} else $("#temperature").html('<i class="fa fa-fw fas fa-temperature-low"></i>&nbsp;Temp:&nbsp;N/A');
// Update every 20 seconds
clearTimeout(sensorsTimer);
sensorsTimer = setTimeout(updateSensorsInfo, 20000);
+1 -1
View File
@@ -577,7 +577,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array('sysadmin', 'dns', 'dhcp
autocorrect="off" id="dhcp.leaseTime" value="">
</div>
</div>
<p>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.</p>
<p>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).</p>
</div>
</div>
<div class="row">