feat(hosts): per-host tags edit + dashboard chip-row filter (P4-07)

This commit is contained in:
2026-05-05 11:16:09 +01:00
parent c1426110e5
commit 168059ae45
8 changed files with 183 additions and 7 deletions
+23 -1
View File
@@ -39,7 +39,13 @@
<span class="dot dot-failed"></span>
{{end}}
<h1 class="mono text-[26px] font-medium tracking-[0.005em] text-ink">{{$host.Name}}</h1>
<div class="flex gap-1.5">{{range $host.Tags}}<span class="tag">{{.}}</span>{{end}}</div>
<div class="flex gap-1.5 items-center">
{{range $host.Tags}}<a href="/?tag={{.}}" class="tag" title="filter dashboard by this tag">{{.}}</a>{{end}}
<button type="button" class="text-ink-fade text-[11px] hover:text-ink-mid"
style="padding: 2px 6px; border: 1px dashed var(--line); border-radius: 3px; cursor: pointer;"
onclick="document.getElementById('tags-edit-{{$host.ID}}').classList.toggle('hidden')"
title="Edit tags">+ tag</button>
</div>
{{if gt $page.ScheduleVersion 0}}
<span class="mono text-[11px] text-ink-mute ml-2">
version {{$page.ScheduleVersion}}
@@ -51,6 +57,22 @@
</span>
{{end}}
</div>
{{/* Inline tags editor — hidden by default; toggled by the "+ tag"
button above. Comma-separated input with autocomplete sourced
from the fleet's distinct tags via a <datalist>. */}}
<form id="tags-edit-{{$host.ID}}" method="post"
action="/hosts/{{$host.ID}}/tags"
class="hidden mt-3 flex items-center gap-2">
<input type="text" name="tags" class="field mono text-[12px]"
style="max-width: 480px;"
value="{{joinComma $host.Tags}}"
list="known-tags"
placeholder="comma-separated · e.g. prod, london, db" />
<datalist id="known-tags">
{{range $page.KnownTags}}<option value="{{.}}">{{end}}
</datalist>
<button type="submit" class="btn btn-primary">Save tags</button>
</form>
<div class="flex items-center gap-3 mt-3 text-[13px] text-ink-mute">
<span class="mono text-ink-mid">{{$host.OS}}/{{$host.Arch}}</span>
<span class="text-ink-fade">·</span>