Add files via upload

Adding:
- health endpoint
- extended /api/config
- frontend extension of backend server viz
This commit is contained in:
Alpha Nerd 2025-08-30 12:43:35 +02:00 committed by GitHub
parent d577099845
commit cb7224c030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 93 additions and 8 deletions

View file

@ -45,6 +45,9 @@
order: 0;
}
}
/* Add a tiny statusstyle section */
.status-ok { color: #006400; font-weight: bold; } /* dark green */
.status-error{ color: #8B0000; font-weight: bold; } /* dark red */
</style>
</head>
<body>
@ -74,9 +77,15 @@
<h2>Configured Endpoints</h2>
<table id="endpoints-table">
<thead><tr><th>Endpoint</th></tr></thead>
<thead>
<tr>
<th>Endpoint</th>
<th>Status</th>
<th>Version</th>
</tr>
</thead>
<tbody id="endpoints-body">
<tr><td class="loading">Loading…</td></tr>
<tr><td colspan="3" class="loading">Loading…</td></tr>
</tbody>
</table>
@ -91,8 +100,22 @@ async function loadEndpoints(){
try{
const data = await fetchJSON('/api/config');
const body = document.getElementById('endpoints-body');
body.innerHTML = data.endpoints.map(e=>`<tr><td class="endpoint">${e}</td></tr>`).join('');
}catch(e){ console.error(e); }
// Map each endpoint object to a table row
body.innerHTML = data.endpoints.map(e => {
const statusClass = e.status === 'ok' ? 'status-ok' : 'status-error';
const version = e.version || 'N/A';
return `
<tr>
<td class="endpoint">${e.url}</td>
<td class="status ${statusClass}">${e.status}</td>
<td class="version">${version}</td>
</tr>`;
}).join('');
}catch(e){
console.error(e);
const body = document.getElementById('endpoints-body');
body.innerHTML = `<tr><td colspan="3" class="loading">Failed to load endpoints</td></tr>`;
}
}
async function loadTags(){
@ -118,4 +141,4 @@ window.addEventListener('load', ()=>{
});
</script>
</body>
</html>
</html>