ui: show pending-hosts panel even when fleet is otherwise empty
CI / Test (store) (pull_request) Successful in 6s
CI / Lint (pull_request) Successful in 20s
CI / Build (windows/amd64) (pull_request) Successful in 10s
CI / Test (rest) (pull_request) Successful in 41s
CI / Build (linux/amd64) (pull_request) Successful in 8s
CI / Build (linux/arm64) (pull_request) Successful in 8s
CI / Test (server-http) (pull_request) Successful in 3m8s
e2e / Playwright vs docker-compose (pull_request) Failing after 3m28s

The dashboard's empty-state ("No hosts yet.") was gated on
HostCount == 0 alone, which hid the pending-hosts panel — and
the inline accept form — for the most common first-run scenario:
operator just installed an agent that announced, the fleet has
zero accepted hosts, and the only thing the operator needs to do
is review fingerprint + click Accept.

Tighten the gate so the empty state only shows when there are
truly zero hosts and zero pending announces. With a pending
host, fall through to the regular dashboard layout so the
approval queue is visible and actionable.

Caught by the e2e enrol-via-announce smoke test (now unblocked
on PR #23).
This commit is contained in:
2026-05-08 21:47:31 +01:00
parent 74be681b4b
commit 523ac4137a
+1 -1
View File
@@ -5,7 +5,7 @@
{{$page := .Page}}
{{template "crit_banner" .Page}}
{{if eq $page.HostCount 0}}
{{if and (eq $page.HostCount 0) (eq (len $page.PendingHosts) 0)}}
{{/* ---------- empty state ---------- */}}
<div class="pt-14 pb-24">