diff options
Diffstat (limited to 'downloads/dashboard.html')
| -rw-r--r-- | downloads/dashboard.html | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/downloads/dashboard.html b/downloads/dashboard.html index 799bdbb..c217e1b 100644 --- a/downloads/dashboard.html +++ b/downloads/dashboard.html @@ -399,6 +399,19 @@ } } + // Network is NEVER rendered as "Offline" from an unknown. The terminal payload stopped + // carrying an `online` boolean because navigator.onLine reports false on a fully connected + // Android WebView; `doctor` is the only thing that probes, and it is the only source that may + // produce a reachable/unreachable verdict. No verdict => 'unknown', never a red dot. + function networkText(health) { + const n = health && health.network; + if (n === 'reachable') return '✅ reachable (doctor)'; + if (n === 'unreachable') return '⚠️ unreachable (doctor)'; + if (typeof n === 'string' && n.indexOf('http-') === 0) return '⚠️ ' + n.replace('http-', 'HTTP ') + ' (doctor)'; + if (n === 'unprobed') return '— not probed'; + return '— unknown (run doctor for a live probe)'; + } + // 2026-10-22: a 10 s cutoff threw away perfectly good data and the page's own auto-refresh // then showed "Cannot connect". Keep whatever exists and let the UI label its age. function fetchDashboardData() { @@ -578,8 +591,8 @@ const health = data.health || {}; let healthHtml = ''; healthHtml += '<div class="metric-row"><span>Modules loaded</span><span>' + (health.modules || '?') + '</span></div>'; - healthHtml += '<div class="metric-row"><span>VFS size</span><span>' + (health.vfsSize || '?') + '</span></div>'; - healthHtml += '<div class="metric-row"><span>Online</span><span>' + (health.online ? '✅ Online' : '🔴 Offline') + '</span></div>'; + healthHtml += '<div class="metric-row"><span>VFS size</span><span>' + (health.vfsSize || '?') + (typeof health.vfsSizeBytes === 'number' && health.vfsSizeBytes >= 1024 ? ' (' + health.vfsSizeBytes + ' B)' : '') + '</span></div>'; + healthHtml += '<div class="metric-row"><span>Network</span><span>' + networkText(health) + '</span></div>'; healthHtml += '<div class="metric-row"><span>Errors</span><span>' + (health.errors > 0 ? '⚠️ ' + health.errors : '✅ 0') + '</span></div>'; healthHtml += '<div class="metric-row"><span>Predictor accuracy</span><span>' + (health.predictorAccuracy || 'N/A') + '</span></div>'; healthDiv.innerHTML = healthHtml; |