feat(logs): URL deep-link + fetched-age chip for AGENT/SYSTEM tabs

Adds ?agent=name and ?unit=svc URL params to pre-select the agent on
the AGENT tab (used by the per-agent overflow menu journal logs link).
Last-fetched timestamp chip shows how stale the output is.

Agent selection is NOT persisted to localStorage — URL params only.
This commit is contained in:
iris 2026-06-05 13:14:58 +02:00 committed by mara
commit b6b93f9fff
4 changed files with 69 additions and 9 deletions

View file

@ -410,14 +410,12 @@ immediate re-fetch.
name (populated from `GET /api/state`) and unit filter
(`hive-ag3nt.service` / `(full machine journal)`). Fetches
`GET /api/journal/{name}?unit=<unit>&lines=500` on selection change
or `↻ refresh`. Output rendered as a `<pre>` block. The last-selected
agent name and unit are persisted to `localStorage` (`logs-agent` /
`logs-unit`) and restored on page load. A `?agent=<name>` and/or
`?unit=<svc>` URL param overrides the stored values — the per-agent
`⋮` menu's **journal logs →** entry uses this to deep-link directly
to a specific agent's journal. A "fetched N ago" chip appears after
the `↻ refresh` button following each successful fetch and ticks
every 30 s.
or `↻ refresh`. Output rendered as a `<pre>` block. A `?agent=<name>`
and/or `?unit=<svc>` URL param pre-selects the agent + unit on page
load — the per-agent `⋮` menu's **journal logs →** entry uses this to
deep-link directly to a specific agent's journal. A "fetched N ago"
chip appears after the `↻ refresh` button following each successful
fetch and ticks every 30 s.
**SYSTEM sub-tab** — host-side service logs. Unit selector (currently
only `hive-c0re.service`). Fetches