ui: P2R-09 auto-init UX — init line in chrome + danger-zone re-init

Latest 'init' job status surfaced under the host-detail vitals strip
(succeeded/failed/running/queued, with link to the live job log on
non-success). New POST /hosts/{id}/repo/reinit handler dispatches a
fresh init job after the operator types the host name to confirm;
audit row records 'host.repo_reinit'.
This commit is contained in:
2026-05-04 10:49:57 +01:00
parent d02a093eeb
commit c9b49637d1
6 changed files with 374 additions and 2 deletions
+16
View File
@@ -105,6 +105,22 @@
</div>
</div>
{{/* ---------- repo init line (P2R-09) ---------- */}}
{{if $page.InitStatus}}
<div class="text-[11.5px] text-ink-mute mt-2.5 leading-[1.5]">
{{if eq $page.InitStatus "succeeded"}}
repo ready · initialised <span class="mono text-ink-mid" {{if $page.InitAt}}title="{{$page.InitAt.Format "2006-01-02 15:04:05 MST"}}"{{end}}>{{relTime $page.InitAt}}</span>
{{else if eq $page.InitStatus "failed"}}
<span class="text-bad font-medium">init failed</span> ·
<a href="/jobs/{{$page.InitJobID}}" class="link mono">job {{$page.InitJobID}}</a> · retry from the Repo tab's danger zone
{{else if eq $page.InitStatus "running"}}
<span class="text-accent">init running…</span> · <a href="/jobs/{{$page.InitJobID}}" class="link mono">live log →</a>
{{else if eq $page.InitStatus "queued"}}
<span class="text-ink-fade">init queued</span> · <a href="/jobs/{{$page.InitJobID}}" class="link mono">job {{$page.InitJobID}}</a>
{{end}}
</div>
{{end}}
{{/* ---------- secondary tabs ---------- */}}
<div class="flex items-end mt-1.5">
<a class="sub-tab {{if eq $page.SubTab "snapshots"}}active{{end}}" href="/hosts/{{$host.ID}}">Snapshots <span class="mono text-ink-fade text-[11px] ml-1">{{comma $host.SnapshotCount}}</span></a>