Skip to content

Commit 326d656

Browse files
Show config health warnings on status dashboard (#222)
Display config_health data from /metrics/public API on the frontend status page. Shows orange banner for degraded status (using platform key) and red banner for error status (missing API key). Part of issue #220.
1 parent c32f5e7 commit 326d656

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

dashboard/osa/index.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,31 @@
244244
.status-error { background: #fee2e2; color: #991b1b; }
245245
.status-unknown { background: #f1f5f9; color: #64748b; }
246246

247+
/* Config health banners */
248+
.config-banner {
249+
border-radius: 8px;
250+
padding: 0.7rem 1rem;
251+
margin-bottom: 1rem;
252+
font-size: 0.85rem;
253+
line-height: 1.5;
254+
}
255+
.config-banner ul {
256+
list-style: none;
257+
margin: 0;
258+
padding: 0;
259+
}
260+
.config-banner li { padding: 0.1rem 0; }
261+
.config-banner-warning {
262+
background: #fff7ed;
263+
border: 1px solid #fed7aa;
264+
color: #9a3412;
265+
}
266+
.config-banner-error {
267+
background: #fef2f2;
268+
border: 1px solid #fecaca;
269+
color: #991b1b;
270+
}
271+
247272
/* Period toggle */
248273
.period-toggle { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
249274
.period-btn {
@@ -801,6 +826,18 @@ <h2>Communities</h2>
801826
healthLabel = healthStatus.charAt(0).toUpperCase() + healthStatus.slice(1);
802827
}
803828

829+
// Config health from public metrics (API key, docs status)
830+
const configHealth = summary.config_health || null;
831+
let configWarningHtml = '';
832+
if (configHealth && configHealth.warnings && configHealth.warnings.length > 0) {
833+
const warningItems = configHealth.warnings.map(w => `<li>${escapeHtml(w)}</li>`).join('');
834+
const bannerClass = configHealth.status === 'error' ? 'config-banner-error' : 'config-banner-warning';
835+
configWarningHtml = `
836+
<div class="config-banner ${bannerClass}">
837+
<ul>${warningItems}</ul>
838+
</div>`;
839+
}
840+
804841
const desc = meta.description
805842
? `<p style="color:#64748b; font-size:0.9rem; margin-bottom:0.75rem;">${escapeHtml(meta.description)}</p>`
806843
: '';
@@ -815,6 +852,7 @@ <h2>${safeName.toUpperCase()}</h2>
815852
</div>
816853
${desc}
817854
${links}
855+
${configWarningHtml}
818856
<div class="overview-grid">
819857
<div class="metric">
820858
<div class="metric-value">${summary.total_requests.toLocaleString()}</div>

0 commit comments

Comments
 (0)