diff --git a/internal/web/handlers/handlers_health_page_test.go b/internal/web/handlers/handlers_health_page_test.go index f8f993f..f9a2399 100644 --- a/internal/web/handlers/handlers_health_page_test.go +++ b/internal/web/handlers/handlers_health_page_test.go @@ -201,7 +201,7 @@ func TestOverviewPageShowsVerdictsAndDomains(t *testing.T) { } for _, want := range []string{ `

`, `class="sp-postmark`, `

mail.example.org

`, - `href="/server/health#certificate"`, `href="/server/health#sockets"`, `href="/outbound/queue"`, + `href="/server/health"`, `href="/server/health"`, `href="/outbound/queue"`, `

Outbound domains

`, `example.org`, "DKIM", "SPF", "DMARC", "1\u00a0msg", `30 days`, `href="/server/health"`, diff --git a/internal/web/handlers/handlers_status.go b/internal/web/handlers/handlers_status.go index 7356fac..0bb0728 100644 --- a/internal/web/handlers/handlers_status.go +++ b/internal/web/handlers/handlers_status.go @@ -326,13 +326,13 @@ func healthCards(c map[string]any) []view.HealthCard { } return []view.HealthCard{ - card("Machine", "ti-cpu", "/server/health#machine", machine.Status, cpu, ram), - card("Processes", "ti-server-cog", "/server/health#processes", c["ProcessStatus"].(health.Status), procValue, procSub), - card("TLS certificate", "ti-certificate", "/server/health#certificate", cert.Status, certValue, cert.Subject), + card("Machine", "ti-cpu", "/server/health", machine.Status, cpu, ram), + card("Processes", "ti-server-cog", "/server/health", c["ProcessStatus"].(health.Status), procValue, procSub), + card("TLS certificate", "ti-certificate", "/server/health", cert.Status, certValue, cert.Subject), card("Queue", "ti-stack-2", "/outbound/queue", c["QueueStatus"].(health.Status), queueValue, "outbound"), - card("Milter sockets", "ti-plug-connected", "/server/health#sockets", c["SocketStatus"].(health.Status), + card("Milter sockets", "ti-plug-connected", "/server/health", c["SocketStatus"].(health.Status), fmt.Sprintf("%d of %d answering", answering, len(sockets)), socketSub), - card("Reverse DNS", "ti-arrows-exchange", "/server/health#hostname", ptr.Status, ptrValue, c["Hostname"].(string)), + card("Reverse DNS", "ti-arrows-exchange", "/server/health", ptr.Status, ptrValue, c["Hostname"].(string)), } } diff --git a/internal/web/handlers/handlers_status_test.go b/internal/web/handlers/handlers_status_test.go index 003117b..f2be960 100644 --- a/internal/web/handlers/handlers_status_test.go +++ b/internal/web/handlers/handlers_status_test.go @@ -38,12 +38,12 @@ func checksFixture() map[string]any { func TestHealthCards(t *testing.T) { cards := healthCards(checksFixture()) want := []struct{ name, level, value, sub, href string }{ - {"Machine", "warn", "No reading", "", "/server/health#machine"}, - {"Processes", "fail", "1 of 2 running", "postfix", "/server/health#processes"}, - {"TLS certificate", "warn", "Expires in 12 days", "mail.example.org", "/server/health#certificate"}, + {"Machine", "warn", "No reading", "", "/server/health"}, + {"Processes", "fail", "1 of 2 running", "postfix", "/server/health"}, + {"TLS certificate", "warn", "Expires in 12 days", "mail.example.org", "/server/health"}, {"Queue", "", "Empty", "outbound", "/outbound/queue"}, - {"Milter sockets", "warn", "1 of 2 answering", "send-log", "/server/health#sockets"}, - {"Reverse DNS", "", "Forward = reverse", "mail.example.org", "/server/health#hostname"}, + {"Milter sockets", "warn", "1 of 2 answering", "send-log", "/server/health"}, + {"Reverse DNS", "", "Forward = reverse", "mail.example.org", "/server/health"}, } if len(cards) != len(want) { t.Fatalf("%d cards, want %d", len(cards), len(want)) diff --git a/internal/web/view/components_test.go b/internal/web/view/components_test.go index 00da32f..9a2ecab 100644 --- a/internal/web/view/components_test.go +++ b/internal/web/view/components_test.go @@ -250,12 +250,12 @@ func TestBoxFootVariants(t *testing.T) { func TestHealthCards(t *testing.T) { out := squash(partial(t, "health_cards", []HealthCard{ - {Name: "Machine", Value: "CPU 12 %", Sub: "RAM 41 %", Icon: "ti-cpu", Href: "/server/health#machine"}, - {Name: "TLS certificate", Value: "Expires in 12 days", Sub: "renewal has not run", Icon: "ti-certificate", Href: "/server/health#certificate", Level: LevelWarn}, - {Name: "Sockets", Value: "1 of 2", Sub: "x", Icon: "ti-plug-connected-x", Href: "/server/health#sockets", Level: LevelFail}, + {Name: "Machine", Value: "CPU 12 %", Sub: "RAM 41 %", Icon: "ti-cpu", Href: "/server/health"}, + {Name: "TLS certificate", Value: "Expires in 12 days", Sub: "renewal has not run", Icon: "ti-certificate", Href: "/server/health", Level: LevelWarn}, + {Name: "Sockets", Value: "1 of 2", Sub: "x", Icon: "ti-plug-connected-x", Href: "/server/health", Level: LevelFail}, })) - mustContain(t, out, `
MachineCPU 12 %RAM 41 %`, - ``, ``) + mustContain(t, out, `
MachineCPU 12 %RAM 41 %`, + ``, ``) } func TestDNSRecordShowsInDNSNowOnlyOnAMismatch(t *testing.T) { diff --git a/internal/web/view/fixtures_test.go b/internal/web/view/fixtures_test.go index 62d172e..6cd29d8 100644 --- a/internal/web/view/fixtures_test.go +++ b/internal/web/view/fixtures_test.go @@ -61,12 +61,12 @@ func admin() Meta { return Meta{User: "admin", IsGlobal: true} } // checks, three outbound domains and two inbound. func overviewFixture() *Overview { cards := []HealthCard{ - {Name: "Machine", Value: "CPU 12%", Sub: "RAM 41%", Icon: "ti-cpu", Href: "/server/health#machine"}, - {Name: "Processes", Value: "5 of 5 running", Sub: "all programs", Icon: "ti-server-cog", Href: "/server/health#processes"}, - {Name: "TLS certificate", Value: "Expires in 12 days", Sub: "mail.example.org", Icon: "ti-certificate", Href: "/server/health#certificate", Level: LevelWarn}, + {Name: "Machine", Value: "CPU 12%", Sub: "RAM 41%", Icon: "ti-cpu", Href: "/server/health"}, + {Name: "Processes", Value: "5 of 5 running", Sub: "all programs", Icon: "ti-server-cog", Href: "/server/health"}, + {Name: "TLS certificate", Value: "Expires in 12 days", Sub: "mail.example.org", Icon: "ti-certificate", Href: "/server/health", Level: LevelWarn}, {Name: "Queue", Value: "Empty", Sub: "outbound", Icon: "ti-stack-2", Href: "/outbound/queue"}, - {Name: "Milter sockets", Value: "2 of 2 answering", Sub: "OpenDKIM, send-log", Icon: "ti-plug-connected", Href: "/server/health#sockets"}, - {Name: "Reverse DNS", Value: "Forward = reverse", Sub: "mail.example.org", Icon: "ti-arrows-exchange", Href: "/server/health#hostname"}, + {Name: "Milter sockets", Value: "2 of 2 answering", Sub: "OpenDKIM, send-log", Icon: "ti-plug-connected", Href: "/server/health"}, + {Name: "Reverse DNS", Value: "Forward = reverse", Sub: "mail.example.org", Icon: "ti-arrows-exchange", Href: "/server/health"}, } o := NewOverview(admin(), "mail.example.org", cards, time.Date(2026, 10, 9, 14, 2, 31, 0, time.UTC), 30, true) dns := func(dkim, spf, dmarc string) []Tag { diff --git a/internal/web/view/pages_test.go b/internal/web/view/pages_test.go index 5456390..20b762a 100644 --- a/internal/web/view/pages_test.go +++ b/internal/web/view/pages_test.go @@ -61,7 +61,7 @@ func TestOverviewHeadFollowsTheCards(t *testing.T) { pageHas(t, "Overview", out, `

Running, with warnings.

`, `class="sp-postmark sp-warn"`, `WARN`, `1 OF 6 CHECKS`, - `Needs attention:
TLS certificate (Expires in 12 days).`, + `Needs attention: TLS certificate (Expires in 12 days).`, `Updated 14:02:31 UTC`, `

mail.example.org

`, `class="sp-warn"`, // the certificate card `href="/server/health"`, `>All details`,