diff --git a/app.js b/app.js index 83667fb..645e171 100644 --- a/app.js +++ b/app.js @@ -1169,24 +1169,53 @@ function updateDevQueue(issues) { } -function updateSovereignHealth() { +async function updateSovereignHealth() { const container = document.getElementById('sovereign-health-content'); if (!container) return; + let metrics = { sovereignty_score: 100, local_sessions: 0, total_sessions: 0 }; + try { + const res = await fetch('http://localhost:8082/metrics'); + if (res.ok) { + metrics = await res.json(); + } + } catch (e) { + // Fallback to static if local daemon not running + console.log('Local health daemon not reachable, using static baseline.'); + } + const services = [ { name: 'FORGE / GITEA', url: 'https://forge.alexanderwhitestone.com', status: 'ONLINE' }, { name: 'NEXUS CORE', url: 'https://forge.alexanderwhitestone.com/Timmy_Foundation/the-nexus', status: 'ONLINE' }, { name: 'HERMES WS', url: 'ws://143.198.27.163:8765', status: wsConnected ? 'ONLINE' : 'OFFLINE' }, - { name: 'SIDE CAR', url: 'http://127.0.0.1:18789', status: 'LOCAL-ONLY' } + { name: 'SOVEREIGNTY', url: 'http://localhost:8082/metrics', status: metrics.sovereignty_score + '%' } ]; container.innerHTML = ''; + + // Add Sovereignty Bar + const barDiv = document.createElement('div'); + barDiv.className = 'meta-stat'; + barDiv.style.flexDirection = 'column'; + barDiv.style.alignItems = 'flex-start'; + barDiv.innerHTML = ` +