agent icon: render on dashboard + per-agent web UI

Consumes the GET /icon endpoint from #139:

- Dashboard: each container card shows the agent's icon next to its
  name (26px). Loaded from <agent-url>/icon; onerror hides it for a
  stopped container whose web server isn't answering.
- Per-agent web UI: the agent's icon next to the page title (40px),
  and /icon as the favicon on the index, stats, and screen pages.

/icon always returns an image (configured SVG or the default
hyperhive logo), so no presence check is needed.

Closes #140
This commit is contained in:
iris 2026-05-21 15:36:58 +02:00
parent 39bd46b244
commit 62aa3bb3ec
6 changed files with 32 additions and 1 deletions

View file

@ -517,6 +517,13 @@
// ── line 1: identity ─────────────────────────────────────────
const head = el('div', { class: 'head' });
head.append(
// /icon always returns an image (the agent's configured SVG or
// the default hyperhive logo). onerror hides it for a stopped
// container whose web server isn't answering.
el('img', {
class: 'container-icon', src: url + 'icon', alt: '', loading: 'lazy',
onerror: "this.style.display='none'",
}),
el('a', { class: 'name', href: url, target: '_blank', rel: 'noopener' }, c.name),
el('span', { class: c.is_manager ? 'role role-m1nd' : 'role role-ag3nt' },
c.is_manager ? 'm1nd' : 'ag3nt'),