P2 redesign Phase 5 — prune/check/unlock + maintenance ticker + repo stats + pending-runs queue #3

Merged
steve merged 37 commits from p2r-phase5-maintenance into main 2026-05-04 10:25:02 +01:00
4 changed files with 10 additions and 3 deletions
Showing only changes of commit 77a8590e3a - Show all commits
+1 -1
View File
@@ -490,7 +490,7 @@ func (s *Server) handleUIAdminCredentialsSave(w stdhttp.ResponseWriter, r *stdht
// We treat this as harmless — they may have wanted to clear via the
// Clear button instead. Only validate if they've started filling fields.
if repoURL == "" && repoUser == "" && repoPass == "" {
stdhttp.Redirect(w, r, "/hosts/"+host.ID+"/repo?saved=admin_credentials", stdhttp.StatusSeeOther)
stdhttp.Redirect(w, r, "/hosts/"+host.ID+"/repo", stdhttp.StatusSeeOther)
return
}
+5 -1
View File
@@ -380,7 +380,7 @@ func TestUIAdminCredentialsSaveAllBlankIsNoop(t *testing.T) {
cookie := loginAsAdmin(t, st)
hostID := makeHost(t, st, "admin-save-blank")
status, _ := postForm(t, baseURL, "/hosts/"+hostID+"/admin-credentials", url.Values{
status, loc := postForm(t, baseURL, "/hosts/"+hostID+"/admin-credentials", url.Values{
"repo_url": {""},
"repo_username": {""},
"repo_password": {""},
@@ -388,6 +388,10 @@ func TestUIAdminCredentialsSaveAllBlankIsNoop(t *testing.T) {
if status != stdhttp.StatusSeeOther {
t.Fatalf("blank save: want 303, got %d", status)
}
// All-blank is a no-op: redirect must not carry ?saved= banner.
if strings.Contains(loc, "?saved=") {
t.Errorf("blank save: redirect Location %q must not contain ?saved=", loc)
}
// No admin row should have been created.
if _, err := st.GetHostCredentials(context.Background(), hostID, store.CredKindAdmin); err == nil {
File diff suppressed because one or more lines are too long
+3
View File
@@ -195,6 +195,7 @@
<div class="grid grid-cols-3 gap-3">
<button type="button"
hx-post="/hosts/{{$host.ID}}/repo/check"
hx-swap="none"
hx-confirm="Run check now ({{$m.CheckSubsetPct}}% data subset)?"
class="btn btn-secondary"
{{if not $page.Online}}disabled title="agent is offline"{{end}}>
@@ -202,6 +203,7 @@
</button>
<button type="button"
hx-post="/hosts/{{$host.ID}}/repo/prune"
hx-swap="none"
hx-confirm="Run prune now? Removes data not referenced by any snapshot — heavy operation."
class="btn btn-secondary"
{{if not $page.HasAdminPassword}}disabled title="set admin credentials first"{{else if not $page.Online}}disabled title="agent is offline"{{end}}>
@@ -209,6 +211,7 @@
</button>
<button type="button"
hx-post="/hosts/{{$host.ID}}/repo/unlock"
hx-swap="none"
hx-confirm="Clear stale repo locks?"
class="btn btn-secondary"
{{if not $page.Online}}disabled title="agent is offline"{{end}}>