Offer archive expiry choices on the target forms, show plain units (closes #396)
check / check (push) Successful in 3m25s

Adding or editing a database target now offers the archive expiry
choices of the new webhook page (never, 1h, 12h, 24h, 30d, 90d, 365d)
in place of a text field. The list is defined once, in
internal/handlers/archive_expiry.go, and all three forms render it. The
edit form starts on the stored expiry; one that is not among the choices
is listed first as its own entry, so saving unchanged keeps it. The
target list shows the expiry in plain units, such as "30 days" or
"12 hours", or "never".

Model: opus-5-5
This commit is contained in:
2026-10-02 22:40:12 +00:00
parent 61371d388e
commit af6cafc535
12 changed files with 387 additions and 72 deletions
+3 -2
View File
@@ -245,8 +245,9 @@ func (h *Handlers) renderTargetEdit(
MaxRetries: target.MaxRetries,
Config: cfg,
},
tmplKeyMaxTimeout: delivery.MaxTargetTimeoutSeconds,
tmplKeyError: errMsg,
tmplKeyMaxTimeout: delivery.MaxTargetTimeoutSeconds,
tmplKeyError: errMsg,
tmplKeyArchiveExpiryChoices: archiveExpiryOptions(cfg.Expiry),
}
h.renderTemplate(w, r, targetEditTemplate, data)