debug(ui): Add visible styling and debug logging for status panel
All checks were successful
All checks were successful
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:
@@ -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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user