Add frontend components and API for system status display
Some checks failed
Deploy to BeePC / deploy (push) Has been cancelled

This commit is contained in:
2026-02-05 11:02:05 -05:00
parent 8a1409b3d6
commit ea6cc3fc85
7 changed files with 327 additions and 41 deletions

34
public/app.js Normal file
View File

@@ -0,0 +1,34 @@
// Fetch and display system status
async function loadStatus() {
try {
const response = await fetch('/api/status');
const data = await response.json();
// Update status message
const statusEl = document.getElementById('status-message');
statusEl.textContent = data.message;
statusEl.classList.remove('loading');
statusEl.classList.add('healthy');
// Update timestamp
const timestamp = new Date(data.timestamp);
document.getElementById('status-timestamp').textContent =
`Last updated: ${timestamp.toLocaleString()}`;
// Update domain
document.getElementById('domain').textContent = data.domain;
// Update version
document.getElementById('version').textContent = data.version;
} catch (error) {
console.error('Error loading status:', error);
document.getElementById('status-message').textContent = 'Error loading status';
document.getElementById('status-message').classList.remove('loading');
}
}
// Load status on page load
document.addEventListener('DOMContentLoaded', loadStatus);
// Refresh status every 30 seconds
setInterval(loadStatus, 30000);