Phase 4 — P4-07: per-host tags + dashboard chip-row filter #15
Reference in New Issue
Block a user
Delete Branch "p4-07-host-tags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes P4-07.
The
tagsJSON column has been onhostssince Phase 1 but had no edit surface and no filter. Wires both — small, mostly UI plumbing.What's in
Free-form tags with autocomplete (option C from the brainstorm). No
tagstable, no "create tag first" ceremony. Operators type comma-separated; the UI offers a<datalist>of tags already in use across the fleet soproddoesn't drift toproduction/Production. Lowercased / trimmed / deduped server-side on save.Inline editor on the host detail header.
+ add tags(oredit tagswhen some exist) reveals an input with autocomplete + a Save button. Persistentfield-helpline below the input — "Comma-separated. Lowercased automatically." — visible always, not just as a placeholder hint that vanishes when the field has a value (operator feedback caught this).Dashboard chip-row above the host table:
Active chip highlighted via a new
.tag-activestyle.?tag=foofilters the list and the count switches toN of M. Tag chips on the host detail header double as quick-filters into the dashboard.Changes
SetHostTags(ctx, hostID, tags),DistinctHostTags(ctx)(uses SQLitejson_eachto union tags across the fleet).POST /hosts/{id}/tagsaudited ashost.tags_updated.host_chromepartial +dashboardpage; new.tag-activeCSS; tag chips on host header link to/?tag=….Test plan
go test ./...Allclears the filter