feat(web): add month and year ranges, data-aware range buttons and region history

Ranges grow to 30d, 90d, 180d and 1y, read from the aggregates, and the
SLA table to 180d and 1y. Ranges and SLA windows less than half covered
by data are shown disabled. Monitor pages chart each region separately
with its share of successful checks. Bars align to TimescaleDB's bucket
origin so multi-day buckets match.

Closes #61

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 09:38:36 +01:00
1 parent 24147ec31d
commit 7a085e22d0
9 files changed
+1368 -857

No files matched your search

+2 -2
View File
@@ -38,9 +38,9 @@ type Bucket struct {
func UptimeBars(buckets []Bucket, end time.Time, step time.Duration, n int, layout string) []Bar {
byStart := make(map[int64]Bucket, len(buckets))
for _, b := range buckets {
byStart[b.Start.Truncate(step).Unix()] = b
byStart[AlignBucket(b.Start, step).Unix()] = b
}
start := end.Truncate(step).Add(-time.Duration(n-1) * step)
start := AlignBucket(end, step).Add(-time.Duration(n-1) * step)
bars := make([]Bar, n)
for i := range bars {
t := start.Add(time.Duration(i) * step)