tidy up forrmatting on pages
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-15 12:11:01 +11:00
parent 0beafb5b00
commit 3f985dcd4d
5 changed files with 135 additions and 43 deletions

View File

@@ -109,10 +109,20 @@ func (h *Handler) renderSnapshotList(w http.ResponseWriter, r *http.Request, sna
entries := make([]views.SnapshotEntry, 0, len(records))
for _, record := range records {
label := report.FormatSnapshotLabel(snapshotType, record.SnapshotTime, record.TableName)
group := ""
switch snapshotType {
case "hourly":
group = record.SnapshotTime.Format("2006-01-02")
case "daily":
group = record.SnapshotTime.Format("January 2006")
case "monthly":
group = record.SnapshotTime.Format("2006")
}
entries = append(entries, views.SnapshotEntry{
Label: label,
Link: "/reports/" + url.PathEscape(record.TableName) + ".xlsx",
Count: record.SnapshotCount,
Group: group,
})
}