feat: dynamic Sovereign Health HUD — Real-time Operational Awareness
Some checks are pending
CI / validate (pull_request) Waiting to run
Some checks are pending
CI / validate (pull_request) Waiting to run
This commit is contained in:
35
app.js
35
app.js
@@ -1169,24 +1169,53 @@ function updateDevQueue(issues) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateSovereignHealth() {
|
async function updateSovereignHealth() {
|
||||||
const container = document.getElementById('sovereign-health-content');
|
const container = document.getElementById('sovereign-health-content');
|
||||||
if (!container) return;
|
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 = [
|
const services = [
|
||||||
{ name: 'FORGE / GITEA', url: 'https://forge.alexanderwhitestone.com', status: 'ONLINE' },
|
{ 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: '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: '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 = '';
|
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 = `
|
||||||
|
<div style="display:flex; justify-content:space-between; width:100%; margin-bottom:4px;">
|
||||||
|
<span>SOVEREIGNTY SCORE</span>
|
||||||
|
<span>${metrics.sovereignty_score}%</span>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%; height:4px; background:rgba(255,255,255,0.1);">
|
||||||
|
<div style="width:${metrics.sovereignty_score}%; height:100%; background:var(--accent-color); box-shadow: 0 0 10px var(--accent-color);"></div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
container.appendChild(barDiv);
|
||||||
|
|
||||||
services.forEach(s => {
|
services.forEach(s => {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.className = 'meta-stat';
|
div.className = 'meta-stat';
|
||||||
div.innerHTML = `<span>${s.name}</span> <span class="${s.status === 'ONLINE' ? 'pse-status' : 'l402-status'}">${s.status}</span>`;
|
div.innerHTML = `<span>${s.name}</span> <span class="${s.status === 'OFFLINE' ? 'status-offline' : 'status-online'}">${s.status}</span>`;
|
||||||
container.appendChild(div);
|
container.appendChild(div);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateNexusCommand(state) {
|
function updateNexusCommand(state) {
|
||||||
|
|||||||
Reference in New Issue
Block a user