{{define "diagnostics.html"}} {{template "base" .}} {{end}} {{define "content"}} {{template "diag-card" .}} {{end}} {{/* Tabs are client-side here (unlike Logs): switching tool only swaps which option fields show, there's no server data to fetch. The Run button opens an EventSource to /maintenance/diagnostics/run; Stop closes it, which cancels the request context and kills the tool. */}} {{define "diag-card"}}
Diagnostics
{{/* One wrapping row: the target grows to fill the left; the per-tool option fields flow to its right, and Source interface + Address family always come last on the line. Per-tool fields show/hide via the [hidden] attr driven by JS keyed on data-tool. */}}
{{/* mtr's cycle/size only appear when continuous mode is off; the toggle itself lives on its own row below so the revealed fields don't intermingle with the checkbox. */}}
{{/* MTR run mode lives on its own row, below the options, so toggling it off reveals Cycles/Size cleanly above without reflowing around the checkbox. */}}
{{/* Shared host history for the target field, persisted in localStorage and rebuilt by JS on each run. */}} {{/* Two output surfaces share the card: a text pane for ping / traceroute / dns, and a live table for mtr. JS toggles which is visible per tool. */}}

Enter a target and press Run.

{{end}} {{/* DNS lookup result fragment, swapped into .diag-dns. */}} {{define "diag-dns-result"}} {{if .Error}}

Lookup failed for {{.Name}}: {{.Error}}

{{else}}

{{.Name}} resolves to:

{{end}} {{end}}