feat(monitoring): add stats counters API and public status page

Add GET /api/stats exposing cumulative counters (feeds created/deleted,
emails received/rejected, recent date-times) plus live values (active
feeds, active WebSub subscriptions). Counters persist in a stats:counters
KV singleton and are incremented at the email-processing chokepoint and
feed create/delete paths. Replace the / → /admin redirect with a public
status page rendering these figures with a link to the admin.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-23 09:50:51 +02:00
parent f4d5edda0e
commit b534ce5bf8
15 changed files with 484 additions and 6 deletions
+33
View File
@@ -1010,3 +1010,36 @@ table.table code {
opacity: 0.6;
pointer-events: none;
}
/* Status page — stat cards grid */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: var(--spacing-md);
margin-bottom: var(--spacing-lg);
}
.stat-card {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
margin-bottom: 0;
}
.stat-value {
font-size: 2rem;
font-weight: 700;
color: var(--color-primary);
line-height: 1.1;
}
.stat-value-time {
font-size: 1rem;
font-weight: 600;
color: var(--color-text-primary);
}
.stat-label {
font-size: 0.85rem;
color: var(--color-text-secondary);
}