debug(ui): Add visible styling and debug logging for status panel
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 56s
CI / Security audit (push) Successful in 1m9s
CI / Tests & coverage (push) Successful in 1m26s

Added debug logging to trace status panel rendering:
- Log when refresh starts
- Log when data is received
- Log errors with details

Also added visible dashed border and background to #status-content
to make it obvious when the div is present but empty.
This commit is contained in:
2026-05-19 22:30:54 +01:00
parent 252cc50aa4
commit d3483f3be7
2 changed files with 13 additions and 4 deletions

View File

@@ -801,16 +801,20 @@ function closeStatusPanel() {
async function refreshStatusPanel() {
const panel = document.getElementById('status-panel');
const contentDiv = document.getElementById('status-content');
if (!panel || panel.style.display === 'none') return;
console.log('[Status] Refreshing status panel...');
try {
const res = await fetch('/api/dashboard/status');
if (!res.ok) throw new Error('Failed to fetch status');
if (!res.ok) throw new Error('Failed to fetch status: ' + res.status);
const data = await res.json();
console.log('[Status] Got status data, rendering...');
renderStatusPanel(data, panel);
} catch (err) {
console.error('[Status] Error fetching status:', err);
// Don't overwrite panel on transient error during auto-refresh
if (!panel.innerHTML || panel.innerHTML.includes('status-loading')) {
panel.innerHTML = '<p class="status-error">Failed to load status.</p>';
if (contentDiv && (!contentDiv.innerHTML || contentDiv.innerHTML.includes('status-loading'))) {
contentDiv.innerHTML = '<p class="status-error">Failed to load status: ' + err.message + '</p>';
}
}
}