Added loading page — SSE-driven splash screen for first-run UX
This commit is contained in:
@@ -1058,14 +1058,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
.then(r => r.json())
|
||||
.then(data => { D = data; init(); connectSSE(); })
|
||||
.catch(() => {
|
||||
// API not ready yet — use inline data as fallback if available
|
||||
if (D && D.meta) { init(); }
|
||||
else { document.getElementById('bootLines').innerHTML = '<div style="color:var(--warn)">Waiting for first sweep...</div>'; }
|
||||
// Retry after a delay
|
||||
setTimeout(() => {
|
||||
fetch('/api/data').then(r => r.json()).then(data => { D = data; init(); connectSSE(); }).catch(() => {});
|
||||
}, 10000);
|
||||
connectSSE();
|
||||
// Should not reach here — server routes to loading.html when no data
|
||||
if (D && D.meta) { init(); connectSSE(); }
|
||||
});
|
||||
} else if (D && D.meta) {
|
||||
// File mode: use inline data
|
||||
|
||||
Reference in New Issue
Block a user