From e54c4906aaaf35f294cdee14a5c28636104f698c Mon Sep 17 00:00:00 2001 From: John Haverlack Date: Sun, 1 Feb 2026 13:14:09 -0900 Subject: [PATCH] Dash: Total Cluster Stats --- sdl-mgr/app/modules/nwa-lib/index.js | 2 +- sdl-mgr/html/js/dash.js | 92 +++++++++++++++++++--------- sdl-mgr/html/md/dash.md | 2 +- 3 files changed, 64 insertions(+), 32 deletions(-) diff --git a/sdl-mgr/app/modules/nwa-lib/index.js b/sdl-mgr/app/modules/nwa-lib/index.js index df7665f..270823e 100644 --- a/sdl-mgr/app/modules/nwa-lib/index.js +++ b/sdl-mgr/app/modules/nwa-lib/index.js @@ -605,7 +605,7 @@ function getUptimeDHMS() { const h = Math.floor((uptimeSec % 86400) / 3600); const m = Math.floor((uptimeSec % 3600) / 60); const s = Math.floor(uptimeSec % 60); - return `${d}.${h}.${m}.${s}`; + return `${d}:${h}:${m}:${s}`; } diff --git a/sdl-mgr/html/js/dash.js b/sdl-mgr/html/js/dash.js index 6d616e6..e6cc551 100644 --- a/sdl-mgr/html/js/dash.js +++ b/sdl-mgr/html/js/dash.js @@ -77,7 +77,7 @@ for (let intf in config.host.network) { } -let host_html = '
SDL Manager Host
\n'; +let host_html = '
Manager
\n'; host_html += '\n'; // host_html += '\n'; // host_html += '\n'; @@ -264,7 +264,7 @@ function renderModulesTable(msg) { // console.log('renderModulesTable()'); // console.log(JSON.stringify(msg, null, 2)); - let sdl_html = '
Cluster Info
'; + let sdl_html = '
Cluster
'; sdl_html += '
'; sdl_html += ` `; @@ -277,28 +277,28 @@ function renderModulesTable(msg) { sdl_html += ` - + `; - sdl_html += ` - - - - - `; + // sdl_html += ` + // + // + // + // + // `; sdl_html += ` - + `; sdl_html += ` - + `; @@ -307,12 +307,20 @@ function renderModulesTable(msg) { const workers = msg.msg.workers || { allocated: 0, available: 0, used: 0 }; sdl_html += ` - + `; + // sdl_html += ` + // + // + // + // + // `; // CPU resources const cpus = msg.msg.resources?.cpus || { allocated: 0, available: 0, used: 0 }; @@ -320,40 +328,64 @@ function renderModulesTable(msg) { `; + // sdl_html += ` + // + // + // + // + // `; // Memory resources const memory = msg.msg.resources?.memory || { allocated: 0, available: 0, used: 0 }; - const memAllocGB = (memory.allocated / 1024).toFixed(1); - const memAvailGB = (memory.available / 1024).toFixed(1); - const memUsedGB = memory.used > 0 ? (memory.used / 1024).toFixed(1) : 0; + const memAllocGB = Math.round(memory.allocated / (1024 * 1024 * 1024)); + const memAvailGB = Math.round(memory.available / (1024 * 1024 * 1024)); + const memUsedGB = memory.used > 0 ? Math.round(memory.used / 1024) : 0; sdl_html += ` - - - - - `; + + + + + `; + // sdl_html += ` + // + // + // + // + // `; // GPU resources const gpus = msg.msg.resources?.gpus || { allocated: 0, available: 0, used: 0 }; sdl_html += ` - + `; - + // sdl_html += ` + // + // + // + // + // `; + sdl_html += `
Uptime (d.h.m.s)Uptime (d:h:m:s) ${msg.msg.sdl.uptime}
Cluster ID${msg.msg.cluster.id}
Cluster ID${msg.msg.cluster.id}
Cluster NameName ${msg.msg.cluster.name}
Cluster DescDescription ${msg.msg.cluster.desc}
SDL Workers (active/total)SDL Workers - ${workers.available} / ${workers.allocated} + ${workers.available}
SDL Workers (active/total) + // ${workers.available} / ${workers.allocated} + //
CPU Cores - ${cpus.available} / ${cpus.allocated} - ${cpus.used > 0 ? `(${cpus.used} in use)` : ''} + ${cpus.available}
CPU Cores + // ${cpus.available} / ${cpus.allocated} + // ${cpus.used > 0 ? `(${cpus.used} in use)` : ''} + //
RAM - ${memAvailGB} / ${memAllocGB} GB - ${memUsedGB > 0 ? `(${memUsedGB} GB in use)` : ''} -
RAM + ${memAvailGB} GB +
RAM (GB) + // ${memAvailGB} / ${memAllocGB} GB + // ${memUsedGB > 0 ? `(${memUsedGB} GB in use)` : ''} + //
GPU GPU (VRAM) - ${gpus.available} / ${gpus.allocated} - ${gpus.used > 0 ? `(${gpus.used} in use)` : ''} + ${gpus.available}
GPU + // ${gpus.available} / ${gpus.allocated} + // ${gpus.used > 0 ? `(${gpus.used} in use)` : ''} + //
diff --git a/sdl-mgr/html/md/dash.md b/sdl-mgr/html/md/dash.md index ebf880f..afd8c68 100644 --- a/sdl-mgr/html/md/dash.md +++ b/sdl-mgr/html/md/dash.md @@ -8,6 +8,6 @@
-
SDL Workers
+
Workers
\ No newline at end of file