From f007786fe435b5fcf29c0f0f9b01aedac2676eaf Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Sat, 30 May 2026 06:46:26 +0000 Subject: [PATCH] Fix services panel: correct services, live refresh loop, last-updated timestamp in footer --- api/endpoints/system.php | 2 +- public_html/index.html | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api/endpoints/system.php b/api/endpoints/system.php index 5cd4321..82589d0 100644 --- a/api/endpoints/system.php +++ b/api/endpoints/system.php @@ -89,7 +89,7 @@ function getNetworkIO(): array { } function getServices(): array { - $services = ['apache2', 'mysql']; + $services = ["lshttpd","mysql","redis","memcached","postfix","dovecot","jarvis-agent"]; $result = []; foreach ($services as $svc) { $out = shell_exec('systemctl is-active ' . escapeshellarg($svc) . ' 2>/dev/null'); diff --git a/public_html/index.html b/public_html/index.html index 0f04d35..3cf74b3 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -822,7 +822,7 @@ body::after{
- JARVIS v2.0 · SECURITY LEVEL ALPHA + JARVIS v2.0 · SECURITY LEVEL ALPHA · UPDATED --:--:--
@@ -1116,8 +1116,12 @@ function toggleCamera() { let _refreshTick = 0; let selectedContext = null; const _panelCtx = {}; +const _svcLabels = {lshttpd:'WEB',mysql:'MYSQL',redis:'REDIS',memcached:'MEMCACHE',postfix:'POSTFIX',dovecot:'DOVECOT','jarvis-agent':'AGENT'}; + async function refreshAll() { _refreshTick++; + const el = document.getElementById('last-refresh'); + if (el) el.textContent = new Date().toLocaleTimeString('en-US',{hour12:false}); try { const s = await api('system'); @@ -1134,11 +1138,15 @@ async function refreshAll() { renderDO(d); } catch(e) {} + // Agent status every tick (updates bottom bar badge) + try { await checkAgentStatus(); } catch(e) {} + // Refresh right-panel tabs every 3rd tick (~30s) if (_refreshTick % 3 === 0) { try { await loadHA(); } catch(e) {} try { await loadAlerts(); } catch(e) {} try { await loadAgents(); } catch(e) {} + try { await loadProxmox(); } catch(e) {} } // Refresh weather + news every 18th tick (~3 min — cache updates every 30 min) if (_refreshTick % 18 === 0) { @@ -1175,8 +1183,8 @@ function renderSystem(s) { const svcEl = document.getElementById('services-list'); svcEl.innerHTML = Object.entries(s.services).map(([k,v]) => `
- ${k.toUpperCase()} -
+ ${_svcLabels[k]||k.toUpperCase()} +
` ).join(''); }