mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 02:38:28 +00:00
Add CPU usage percentage to the Load tooltip
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -344,15 +344,17 @@ function updateSystemInfo() {
|
|||||||
);
|
);
|
||||||
$("#cpu").prop(
|
$("#cpu").prop(
|
||||||
"title",
|
"title",
|
||||||
"Load averages for the past 1, 5, and 15 minutes\non a system with " +
|
"CPU usage: " +
|
||||||
|
system.cpu["%cpu"].toFixed(1) +
|
||||||
|
"%\nLoad averages for the past 1, 5, and 15 minutes\non a system with " +
|
||||||
system.cpu.nprocs +
|
system.cpu.nprocs +
|
||||||
" core" +
|
" core" +
|
||||||
(system.cpu.nprocs > 1 ? "s" : "") +
|
(system.cpu.nprocs > 1 ? "s" : "") +
|
||||||
" running " +
|
" running " +
|
||||||
system.procs +
|
system.procs +
|
||||||
" processes " +
|
" processes" +
|
||||||
(system.cpu.load.raw[0] > system.cpu.nprocs
|
(system.cpu.load.raw[0] > system.cpu.nprocs
|
||||||
? " (load is higher than the number of cores)"
|
? "\n(load is higher than the number of cores)"
|
||||||
: "")
|
: "")
|
||||||
);
|
);
|
||||||
$("#sysinfo-cpu").text(
|
$("#sysinfo-cpu").text(
|
||||||
|
|||||||
Reference in New Issue
Block a user