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 93ab0ae84f
commit cce3cd8384
6 changed files with 374 additions and 2 deletions
+10 -2
View File
@@ -238,8 +238,16 @@
<span class="mono text-ink-mid">secrets.enc</span> is reused.
</p>
</div>
<button class="btn btn-danger btn-lg flex-none" disabled
title="re-init flow lands in P2R-09">Re-init repo…</button>
<form method="post" action="/hosts/{{$host.ID}}/repo/reinit"
class="flex-none flex flex-col items-end" style="gap: 8px;"
onsubmit="return confirm('Re-initialise the repo on host &quot;{{$host.Name}}&quot;? Existing snapshots are lost if the rest-server allows the wipe; restic refuses if it sees a config file already there.');">
<input type="text" name="confirm_hostname" required autocomplete="off"
placeholder="type hostname to confirm"
class="input mono"
style="width: 240px; height: 30px; padding: 0 8px; font-size: 12px;">
<button type="submit" class="btn btn-danger btn-lg whitespace-nowrap"
{{if eq $host.Status "online"}}{{else}}disabled title="host is offline"{{end}}>Re-init repo…</button>
</form>
</div>
</div>
</div>