panel-redesign: the health cards of Overview carry no anchor
Follows the design commit before it: Machine, Processes, TLS certificate, Milter sockets and Reverse DNS lead to /server/health as it opens; so does the link in the Needs attention line, which takes its address from the card. go vet ./internal/web/...: ok go test -count=1 ./internal/web/...: ok Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -201,7 +201,7 @@ func TestOverviewPageShowsVerdictsAndDomains(t *testing.T) {
|
||||
}
|
||||
for _, want := range []string{
|
||||
`<h1 class="title is-3">`, `class="sp-postmark`, `<p class="sp-kicker">mail.example.org</p>`,
|
||||
`href="/server/health#certificate"`, `href="/server/health#sockets"`, `href="/outbound/queue"`,
|
||||
`href="/server/health"`, `href="/server/health"`, `href="/outbound/queue"`,
|
||||
`<h2>Outbound domains</h2>`, `<a href="/outbound/domains/1"><strong>example.org</strong></a>`,
|
||||
"DKIM", "SPF", "DMARC", "1\u00a0msg", `<th>30 days</th>`,
|
||||
`href="/server/health"`,
|
||||
|
||||
@@ -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)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user