From 8001234e8bab3dcc8914cb3675974e623d6d8b3b Mon Sep 17 00:00:00 2001 From: mrambossek Date: Sat, 1 Aug 2026 23:04:55 +0200 Subject: [PATCH] adminui: render the self-test instead of dumping it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The box under "Self-test" was `%+v` of a Go struct on one line, read through a horizontal scrollbar — on a phone you could see about six words of it, from the middle. The design pass had polished the frame around it and left the contents a debug dump. The report was structured the whole time: each sysctl check carries the name, what was found, what was wanted, a severity, and a sentence explaining why the setting matters to measurement. All of that was being flattened into one string. It now renders as records like everything else, with the explanation set as prose across the full row, because it is a sentence and not a fourth column. Two faults the render caught: the desktop row grid applied to every readout, so the standalone summary panel was chopped into four narrow columns and "full 1500" broke into "ful/l/150/0"; and a fixed first column wrapped `net.ipv6.conf.all.accept_ra` mid-word. The grid is now scoped to readouts inside a row, and the label column may grow to 18rem before it wraps. Co-Authored-By: Claude Opus 5 --- server/internal/adminui/render.go | 59 ++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/server/internal/adminui/render.go b/server/internal/adminui/render.go index 44b93b6..0e694c9 100644 --- a/server/internal/adminui/render.go +++ b/server/internal/adminui/render.go @@ -155,6 +155,9 @@ const baseHTML = ` font:.85rem/1.3 var(--mono);margin-bottom:.35rem} .rec-head .id{overflow-wrap:anywhere;color:var(--ink)} .rec form{margin-top:.6rem} + /* Why a check matters is a sentence, so it is set as one — full width under the row rather + than squeezed into a column, where it would wrap to a ribbon two words wide. */ + .why{font:.85rem/1.5 var(--prose);color:var(--dim);margin-top:.45rem;max-width:52rem} .tag{font:.68rem/1 var(--mono);letter-spacing:.1em;text-transform:uppercase; padding:.24rem .45rem;border-radius:2px;border:1px solid currentColor;white-space:nowrap} .v-green{color:var(--green)} .v-yellow{color:var(--amber)} @@ -196,17 +199,19 @@ const baseHTML = ` main{padding:1.6rem} .recs{margin:.8rem 0} /* Every row shares one grid, so the columns agree across rows without a header or a table. */ - .rec{display:grid;grid-template-columns:12.5rem minmax(0,1fr) auto;gap:.35rem 1.4rem; + .rec{display:grid;grid-template-columns:minmax(12.5rem,18rem) minmax(0,1fr) auto;gap:.35rem 1.4rem; align-items:baseline;background:none;border:0;border-bottom:1px solid var(--rule); border-radius:0;padding:.6rem 0;margin:0} .rec-head{margin:0;flex-direction:column;align-items:flex-start;gap:.3rem} .rec form{margin:0} /* Widths follow the content: a device name needs room, a finding count does not. */ - .readout{display:grid;grid-template-columns:1.7fr .9fr .9fr 1.1fr;gap:.15rem 1.2rem} - .readout li{padding:0} - .readout .lead{display:none} - .readout .v{text-align:left} + .rec .readout{display:grid;grid-template-columns:1.7fr .9fr .9fr 1.1fr;gap:.15rem 1.2rem} + .rec .readout li{padding:0} + .rec .readout .lead{display:none} + .rec .readout .v{text-align:left} .open{white-space:nowrap} + /* Spans the full row: the sentence is the useful part, not a fourth column. */ + .why{grid-column:1/-1;margin-top:.1rem} }
@@ -270,9 +275,47 @@ const baseHTML = ` {{end}} {{with .SelfTest}}

Self-test

-

What this server can measure from where it stands. A capability missing here is - missing from every run it takes part in.

-
{{printf "%+v" .}}
+

What this server can measure from where it stands, checked at startup. A + capability missing here is missing from every run this server takes part in — so a + client asking for that measurement gets nothing, rather than a wrong answer.

+
    +
  • kernel settings + {{if .SysctlOK}}as needed{{else}}need attention{{end}}
  • +
  • egress path MTU + {{if .MTUOK}}full 1500{{else}}reduced{{end}}
  • +
+ {{if .Sysctls}} +

Kernel settings

+
+ {{range .Sysctls}} +
+
{{.Name}} + {{.Severity}}
+
    +
  • found{{.Got}}
  • +
  • wanted{{.Want}}
  • +
+
{{.Why}}
+
+ {{end}} +
+ {{end}} + {{if .EgressMTU}} +

Egress path MTU

+
+ {{range .EgressMTU}} +
+
{{.Target}} + {{if .FullMTU}}full{{else}}reduced{{end}}
+
    +
  • discovered + {{if .DiscoveredMTU}}{{.DiscoveredMTU}} bytes{{else}}not measured{{end}}
  • +
+ {{with .Err}}
{{.}}
{{end}} +
+ {{end}} +
+ {{end}} {{end}} {{else if eq .Page "devices"}}