System Columnn Display

This commit is contained in:
John Haverlack 2026-02-08 15:38:01 -09:00
parent b63e038f10
commit b69513019b
7 changed files with 118 additions and 66 deletions

View File

@ -56,7 +56,14 @@ Or to get the install command from the beacon message:
nc -u -l -k 10101 | jq -r '.msg.sdl_wkr_install_cmd[]' nc -u -l -k 10101 | jq -r '.msg.sdl_wkr_install_cmd[]'
``` ```
> NOTE: CTRL-C to exit `nc`. You cannot run `nc` on port 10101 in parallel with the sdl-wkr. So run it once to get the install command. Tnen install sdl-wkr. **NOTE**: If you use UFW or a local firewall, you must allow SDL Worker to listen on UDP port 10101.
```
sudo ufw allow in proto udp from <NETWORK CIDR> to any port 10101
```
> **NOTE**: CTRL-C to exit `nc`. You cannot run `nc` on port 10101 in parallel with the sdl-wkr. So run it once to get the install command. Tnen install sdl-wkr.
Run the **curl** or **wget** command provided by SDL Manager UDP beacon to install SDL Worker locally. Run the **curl** or **wget** command provided by SDL Manager UDP beacon to install SDL Worker locally.

View File

@ -1,5 +1,12 @@
{ {
"releases": [ "releases": [
{
"version": "0.3.9",
"date": "2026-02-08",
"maturity": "ALPHA",
"summary": "",
"notes": ""
},
{ {
"version": "0.3.8", "version": "0.3.8",
"date": "2026-02-01", "date": "2026-02-01",

View File

@ -5,11 +5,35 @@
| **Author** | John Haverlack | | **Author** | John Haverlack |
| **Copyright** | 2026 John Haverlack | | **Copyright** | 2026 John Haverlack |
| **License** | MIT | | **License** | MIT |
| **Version** | 0.3.8 | | **Version** | 0.3.9 |
| **Date** | 2026-02-01 | | **Date** | 2026-02-08 |
## v0.3.9 - 2026-02-08 (ALPHA)
- Start v0.3.9
## v0.3.8 - 2026-02-01 (ALPHA) ## v0.3.8 - 2026-02-01 (ALPHA)
- v0.3.8
- Refactoing Worker Dashboard
- Refactoing Worker Dashboard
- Refactored Cluster Status
- Refactor of telemetry format + hw detection
- Switched Panel Icon to Bootstrap Icon
- Updating Worker Telemetry
- CP
- Fixing Wget/Curl Command Installer Port
- Fixing Wget/Curl Command Installer Port
- Fixing Wkr Start / Stop
- Update stop-sdl-wkr.sh
- WIP Install / Start / Stop
- WIP Install / Start /Stop
- Systemd Detectiion in Start/Stop/Status
- WIP: Start / Stop Scripts
- Non Systemd start stop scripts
- WIP: start stop scripts
- Updating Task List
- Adding Screeshot to README
- Start v0.3.8 - Start v0.3.8
## v0.3.7 - 2026-02-01 (ALPHA) ## v0.3.7 - 2026-02-01 (ALPHA)

View File

@ -557,31 +557,7 @@ function startTelemetryListener() {
const now = new Date(); const now = new Date();
// ✅ Build/update worker state from telemetry // ✅ Build/update worker state from telemetry
workersState[sdl_id] = { workersState[sdl_id] = telemetry
sdl_id: sdl_id,
hostname: hostname,
role: telemetry.role,
last_seen: now.toISOString(), // ✅ ISO string
last_seen_utime: Math.floor(now.getTime() / 1000), // ✅ Unix timestamp (seconds)
// System info
platform: telemetry.msg?.system?.platform,
arch: telemetry.msg?.system?.arch,
distro: telemetry.msg?.system?.distro,
hardware: telemetry.msg?.system?.hardware,
// Uptime
uptime: telemetry.msg?.uptime,
// Resources
resources: telemetry.msg?.resources,
// Usage
usage: telemetry.msg?.usage,
// Load
load: telemetry.msg?.load
};
} catch (err) { } catch (err) {
log(`${module}: failed to process telemetry: ${err}`); log(`${module}: failed to process telemetry: ${err}`);

View File

@ -513,57 +513,65 @@ function renderWorkersTable(msg) {
const staleThresholdSec = 60; const staleThresholdSec = 60;
for (const [sdl_id, worker] of Object.entries(workers)) { for (const [sdl_id, worker] of Object.entries(workers)) {
const ageSec = nowSec - worker.last_seen_utime; const ageSec = nowSec - worker.ts_utime; // ✅ Use ts_utime from telemetry
const isActive = ageSec <= staleThresholdSec; const isActive = ageSec <= staleThresholdSec;
// Status badge // Status badge
const statusBadge = isActive const statusBadge = isActive
? '<span class="badge bg-success">Active</span>' ? '<span class="badge bg-success">Active</span>'
: '<span class="badge bg-danger">Inactive</span>'; // ✅ Red instead of grey : '<span class="badge bg-danger">Inactive</span>';
// Hardware info // ✅ Hardware info from nested msg.system.hardware
const hwType = worker.hardware?.type || 'unknown'; const hwType = worker.msg?.system?.hardware?.type || 'unknown';
const hwIcon = hwType === 'hw' ? '🖥️' : hwType === 'vm' ? '💠' : '❓'; // const hwIcon = hwType === 'hw' ? '🖥️' : hwType === 'vm' ? '💠' : '❓';
const hwManuf = worker.hardware?.manufacturer || 'Unknown'; const hwIcon = hwType === 'hw' ? '<i class="fa fa-desktop"></i>' :
const hwModel = worker.hardware?.model || 'Unknown'; hwType === 'vm' ? '<i class="fa fa-cube"></i>' :
'<i class="fa fa-question"></i>';
const hwManuf = worker.msg?.system?.hardware?.manufacturer || 'Unknown';
const hwModel = worker.msg?.system?.hardware?.model || 'Unknown';
const hwCPU = worker.msg?.system?.hardware?.cpu || 'Unknown';
// ✅ Full hardware display with model
const hardwareDisplay = hwType === 'vm' const hardwareDisplay = hwType === 'vm'
? `${hwIcon} ${hwModel}` ? `${hwIcon} ${hwModel}`
: `${hwIcon} ${hwManuf} ${hwModel}`; : `${hwIcon} ${hwManuf} ${hwModel}`;
// ✅ OS info // ✅ OS info from nested msg.system
const osDistro = worker.distro || 'Unknown'; const osDistro = worker.msg?.system?.distro.replace(/\(\S+\)/, '') || 'Unknown';
const osArch = worker.arch || 'unknown'; const osArch = worker.msg?.system?.arch || 'unknown';
const osPlatform = worker.platform || 'unknown'; const osPlatform = worker.msg?.system?.platform || 'unknown';
const platformIcon = osPlatform === 'linux' ? '<i class="fab fa-linux"></i>' :
osPlatform === 'win32' ? '<i class="fab fa-windows"></i>' :
osPlatform === 'darwin' ? '<i class="fab fa-apple"></i>' :
'<i class="fa fa-question"></i>';
// CPU const osDisplay = `${platformIcon} ${osDistro} (${osArch})`;
const cpuAvail = worker.resources?.cpus?.available || 0;
const cpuTotal = worker.resources?.cpus?.allocated || 0;
const cpuUsed = worker.usage?.cpu?.total || 0;
// Memory // ✅ CPU from nested msg.resources and msg.usage
const memAvail = worker.resources?.memory?.available || 0; const cpuAvail = worker.msg?.resources?.cpus?.available || 0;
const memTotal = worker.resources?.memory?.allocated || 0; const cpuTotal = worker.msg?.resources?.cpus?.allocated || 0;
const memUsed = worker.usage?.memory?.used || 0; const cpuUsed = worker.msg?.usage?.cpu?.total || 0;
// ✅ Memory from nested msg
const memAvail = worker.msg?.resources?.memory?.available || 0;
const memTotal = worker.msg?.resources?.memory?.allocated || 0;
const memAvailGB = Math.round(memAvail / (1024 * 1024 * 1024)); const memAvailGB = Math.round(memAvail / (1024 * 1024 * 1024));
const memTotalGB = Math.round(memTotal / (1024 * 1024 * 1024)); const memTotalGB = Math.round(memTotal / (1024 * 1024 * 1024));
const memPercent = worker.usage?.memory?.percent_used || 0; const memPercent = worker.msg?.usage?.memory?.percent_used || 0;
// GPU // GPU from nested msg
const gpuAvail = worker.resources?.gpus?.available || 0; const gpuAvail = worker.msg?.resources?.gpus?.available || 0;
const gpuTotal = worker.resources?.gpus?.allocated || 0; const gpuTotal = worker.msg?.resources?.gpus?.allocated || 0;
const gpuData = worker.usage?.gpu; const gpuData = worker.msg?.usage?.gpu;
const gpuUsed = gpuData?.total_utilization || 0; const gpuUsed = gpuData?.total_utilization || 0;
const gpuMemMB = gpuData?.total_memory_total_mb || 0; const gpuMemMB = gpuData?.total_memory_total_mb || 0;
const gpuMemGB = Math.round(gpuMemMB / 1024); const gpuMemGB = Math.round(gpuMemMB / 1024);
// Uptime // Uptime from nested msg.uptime
const procUptime = worker.uptime?.proc_dhms || 'N/A'; const procUptime = worker.msg?.uptime?.proc_dhms || 'N/A';
const sysUptime = worker.uptime?.sys_dhms || 'N/A'; const sysUptime = worker.msg?.uptime?.sys_dhms || 'N/A';
// Last seen age // Last seen age
const days = Math.floor(ageSec / 86400); const days = Math.floor(ageSec / 86400);
const hours = Math.floor((ageSec % 86400) / 3600); const hours = Math.floor((ageSec % 86400) / 3600);
const minutes = Math.floor((ageSec % 3600) / 60); const minutes = Math.floor((ageSec % 3600) / 60);
@ -577,15 +585,16 @@ function renderWorkersTable(msg) {
html += '<tr>'; html += '<tr>';
// ✅ Hostname column with hardware underneath // System column
html += `<td> html += `<td>
<strong>${worker.hostname}</strong><br> <strong>${worker.host}</strong><br>
<small class="text-muted" style="font-size:0.7em">${worker.sdl_id}</small><br> <small class="text-muted" style="font-size:0.7em">${worker.sdl_id.substring(0, 8)}...</small><br>
<small class="text-muted" style="font-size:0.8em">${hardwareDisplay}</small><br> <small class="text-muted" style="font-size:0.8em">${hardwareDisplay}</small><br>
<small class="text-muted" style="font-size:0.8em">${osDistro} ${osArch} ${osPlatform}</small> <small class="text-muted" style="font-size:0.75em"><i title="CPU" class="fa fa-microchip"></i> <i class="fa fa-memory"></i> <span class="dash-val" style="font-weight:bold">${memTotalGB}</span> GB | <span class="dash-val" style="font-weight:bold"> ${cpuTotal}</span>x ${hwCPU}} </small><br>
<small class="text-muted" style="font-size:0.75em">${osDisplay}</small>
</td>`; </td>`;
// Status column with uptime and last seen // Status column
html += `<td> html += `<td>
${statusBadge}<br> ${statusBadge}<br>
<small class="text-muted">SDL: ${procUptime}</small><br> <small class="text-muted">SDL: ${procUptime}</small><br>

View File

@ -5,11 +5,35 @@
| **Author** | John Haverlack | | **Author** | John Haverlack |
| **Copyright** | 2026 John Haverlack | | **Copyright** | 2026 John Haverlack |
| **License** | MIT | | **License** | MIT |
| **Version** | 0.3.8 | | **Version** | 0.3.9 |
| **Date** | 2026-02-01 | | **Date** | 2026-02-08 |
## v0.3.9 - 2026-02-08 (ALPHA)
- Start v0.3.9
## v0.3.8 - 2026-02-01 (ALPHA) ## v0.3.8 - 2026-02-01 (ALPHA)
- v0.3.8
- Refactoing Worker Dashboard
- Refactoing Worker Dashboard
- Refactored Cluster Status
- Refactor of telemetry format + hw detection
- Switched Panel Icon to Bootstrap Icon
- Updating Worker Telemetry
- CP
- Fixing Wget/Curl Command Installer Port
- Fixing Wget/Curl Command Installer Port
- Fixing Wkr Start / Stop
- Update stop-sdl-wkr.sh
- WIP Install / Start / Stop
- WIP Install / Start /Stop
- Systemd Detectiion in Start/Stop/Status
- WIP: Start / Stop Scripts
- Non Systemd start stop scripts
- WIP: start stop scripts
- Updating Task List
- Adding Screeshot to README
- Start v0.3.8 - Start v0.3.8
## v0.3.7 - 2026-02-01 (ALPHA) ## v0.3.7 - 2026-02-01 (ALPHA)

View File

@ -391,9 +391,13 @@ function publishTelemetry(topic) {
? Math.round(perCpuUsage.reduce((sum, usage) => sum + usage, 0) / perCpuUsage.length) ? Math.round(perCpuUsage.reduce((sum, usage) => sum + usage, 0) / perCpuUsage.length)
: 0; : 0;
const now = new Date();
const telemetry = { const telemetry = {
ts: new Date().toISOString(), ts: now.toISOString(),
ts_utime: Math.floor(now.getTime() / 1000),
sdl_id: config.identity.sdl_id, sdl_id: config.identity.sdl_id,
sdl_ver: config.sdl.version,
role: 'sdl-wkr', role: 'sdl-wkr',
host: config.identity.hostname, host: config.identity.hostname,
type: 'worker-telemetry', type: 'worker-telemetry',
@ -511,7 +515,8 @@ function getSystemHardware() {
const hardware = { const hardware = {
type: 'unknown', type: 'unknown',
manufacturer: 'Unknown', manufacturer: 'Unknown',
model: 'Unknown' model: 'Unknown',
cpu: config.host.cpu.model
}; };
// Only run Linux-specific detection on Linux // Only run Linux-specific detection on Linux