summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2024-07-08 04:34:32 +0300
committerMaxim Devaev <[email protected]>2024-07-08 04:34:32 +0300
commiteb1eb527f8b7d0e3156f80564d8798fffacdd3ed (patch)
tree9a9f71c2a1cf35540da0fe86f56a15085df0db24 /web
parent01fff2c7a9404c963800b2df43debb816ad89874 (diff)
pikvm/pikvm#1347: added CPU and MEM to /api/info
Diffstat (limited to 'web')
-rw-r--r--web/share/js/kvm/session.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js
index 8b89b71c..a183b33e 100644
--- a/web/share/js/kvm/session.js
+++ b/web/share/js/kvm/session.js
@@ -132,7 +132,7 @@ export function Session() {
if (__info_hw_state !== null) {
html += `
Platform:
- ${__formatPlatform(__info_hw_state.platform)}
+ ${__formatMisc(__info_hw_state)}
<hr>
Temperature:
${__formatTemp(__info_hw_state.health.temp)}
@@ -153,8 +153,13 @@ export function Session() {
$("about-hardware").innerHTML = html;
};
- var __formatPlatform = function(state) {
- return __formatUl([["Base", state.base], ["Serial", state.serial]]);
+ var __formatMisc = function(state) {
+ return __formatUl([
+ ["Base", state.platform.base],
+ ["Serial", state.platform.serial],
+ ["CPU", `${state.health.cpu.percent}%`],
+ ["MEM", `${state.health.mem.percent}%`],
+ ]);
};
var __formatFan = function(state) {