diff --git a/apps/admin-portal/src/components/IconTile/IconTile.module.scss b/apps/admin-portal/src/components/IconTile/IconTile.module.scss index 83e944eb..07122e14 100644 --- a/apps/admin-portal/src/components/IconTile/IconTile.module.scss +++ b/apps/admin-portal/src/components/IconTile/IconTile.module.scss @@ -37,6 +37,11 @@ --tile-color: var(--color-state-shared); } +// The same amber the warning mark on a card's note wears. +.warn { + --tile-color: var(--color-accent); +} + // The series colour is set by the card the tile sits in. Outside one, the // accent stands in rather than an unset variable dropping the declaration. .series { diff --git a/apps/admin-portal/src/components/IconTile/IconTile.tsx b/apps/admin-portal/src/components/IconTile/IconTile.tsx index 92a510f6..caa15fc1 100644 --- a/apps/admin-portal/src/components/IconTile/IconTile.tsx +++ b/apps/admin-portal/src/components/IconTile/IconTile.tsx @@ -2,8 +2,9 @@ import { Icon, type IconName } from '@/components/Icon/Icon' import styles from '@/components/IconTile/IconTile.module.scss' /** Whose colour the tile wears: the host's series colour beside a reading, - the healthy green on a status, muted on inventory and toolbar marks. */ -export type IconTileTone = 'muted' | 'ok' | 'series' + the healthy green or the warning amber on a status, muted on inventory and + toolbar marks. */ +export type IconTileTone = 'muted' | 'ok' | 'series' | 'warn' /** Inventory rows and the status pill, the toolbar marks, the readings. */ export type IconTileSize = 'sm' | 'md' | 'lg' @@ -19,6 +20,7 @@ const TONE_CLASS: Record = { muted: styles.muted, ok: styles.ok, series: styles.series, + warn: styles.warn, } const SIZE_CLASS: Record = { diff --git a/apps/admin-portal/src/pages/Fleet/Fleet.test.tsx b/apps/admin-portal/src/pages/Fleet/Fleet.test.tsx index a18be0c6..d6d1ffa7 100644 --- a/apps/admin-portal/src/pages/Fleet/Fleet.test.tsx +++ b/apps/admin-portal/src/pages/Fleet/Fleet.test.tsx @@ -272,13 +272,16 @@ test('HostCard links to whichever console the monitor names', () => { expect(link).toHaveAccessibleDescription('Opens UGOS in a new tab') }) -/* A warn host prints no status word at all: the finding is the disk and load - figures the monitor judged, not a phrase summarising them over the name. */ -test('HostCard prints no status line on a warn host', () => { +/* Every card carries a status pill, so a warn host states its case in a word + too, in the warning tone and never the healthy one. */ +test('HostCard marks a warn host as needing attention, never as healthy', () => { render() expect(screen.getByRole('heading', { name: 'vermithor' })).toBeInTheDocument() - expect(screen.queryByText(/Needs attention/)).toBeNull() + const tile = screen.getByText('Needs attention').closest('p')?.querySelector('.tile') + expect(tile).toHaveAttribute('aria-hidden', 'true') + expect(tile).toHaveClass('warn') + expect(tile).not.toHaveClass('ok') expect(screen.queryByText('Healthy')).toBeNull() }) @@ -394,6 +397,25 @@ test('HostCard never presents an unqualified ok status when metrics are stale', expect(screen.getByText('Healthy as of the last reading')).toBeInTheDocument() }) +/* A warn verdict is computed from the same slow-tier disk reading, so it takes + the same qualification a healthy one does. */ +test('HostCard never presents an unqualified warn status when metrics are stale', () => { + render( + , + ) + + expect(screen.queryByText('Needs attention')).toBeNull() + expect(screen.getByText('Needs attention as of the last reading')).toBeInTheDocument() +}) + test('HostCard leaves the status unqualified when every metric is fresh', () => { render() diff --git a/apps/admin-portal/src/pages/Fleet/HostCard.tsx b/apps/admin-portal/src/pages/Fleet/HostCard.tsx index 488a532e..25aa0191 100644 --- a/apps/admin-portal/src/pages/Fleet/HostCard.tsx +++ b/apps/admin-portal/src/pages/Fleet/HostCard.tsx @@ -18,23 +18,18 @@ type HostCardProps = { readonly className?: string } -/* null is "print no status line", not "no status": a warn host states its case - through the disk and load figures below and the stale note beside them, - which are the readings the monitor judged, rather than through a summary - word sitting over them. */ -const STATUS_LABEL: Record = { - ok: 'Healthy', - warn: null, - unknown: 'Not collected', -} +/* Every card carries a status word, so a missing pill never has to be read as + a verdict. A warn host says only that it needs attention: which reading + crossed the line is the monitor's call, and the disk and load figures below + are where it shows. -/* The tile beside the status word. Never collected is an absence, not a + The tile restates the word beside it. Never collected is an absence, not a health, so it wears the muted tone: a green tile on it would let a reader's - eye file the card as fine before the word beside it said otherwise. */ -const STATUS_MARK: Record = { - ok: { name: 'check', tone: 'ok' }, - warn: null, - unknown: { name: 'help', tone: 'muted' }, + eye file the card as fine before the word said otherwise. */ +const STATUS: Record = { + ok: { label: 'Healthy', icon: 'check', tone: 'ok' }, + warn: { label: 'Needs attention', icon: 'warn', tone: 'warn' }, + unknown: { label: 'Not collected', icon: 'help', tone: 'muted' }, } /* The status word is computed from disk and load, and disk is a slow-tier @@ -228,11 +223,10 @@ export const HostCard = ({ host, className }: HostCardProps) => { /* A never-collected host is already unqualified-proof: its label is the absence itself. Only a collected host can carry a stale present tense. */ const staleStatus = host.status !== 'unknown' && host.metrics_stale - const label = STATUS_LABEL[host.status] - const mark = STATUS_MARK[host.status] + const status = STATUS[host.status] /* One text node, not a word plus a decorative span: the qualification has to be part of the status itself, not something a reader can visually skip. */ - const statusText = label === null ? null : `${label}${staleStatus ? STALE_STATUS_SUFFIX : ''}` + const statusText = `${status.label}${staleStatus ? STALE_STATUS_SUFFIX : ''}` /* The core count is observed, not assumed, so it is worth showing: it is what the load figure above it was divided by. */ const coreContext = @@ -270,12 +264,10 @@ export const HostCard = ({ host, className }: HostCardProps) => {

{host.ip}

{/* status is stated in text, never by color alone: the tile restates the word beside it and is hidden from the accessibility tree */} - {!!statusText && ( -

- {!!mark && } - {statusText} -

- )} +

+ + {statusText} +

diff --git a/apps/fleet-monitor/src/config.test.ts b/apps/fleet-monitor/src/config.test.ts index b5202e44..9435074b 100644 --- a/apps/fleet-monitor/src/config.test.ts +++ b/apps/fleet-monitor/src/config.test.ts @@ -34,9 +34,13 @@ describe('config', () => { expect(names(HOSTS)).toEqual(['balerion', 'caraxes', 'meleys', 'syrax', 'vermithor', 'vhagar']) }) - it('gives only vermithor and vhagar a render node', () => { - // measured 2026-08-10: meleys is AMD, syrax is Atom, caraxes is ARM; balerion is unprobed - expect(names(HOSTS.filter(({ has_gpu }) => has_gpu))).toEqual(['vermithor', 'vhagar']) + it('gives only balerion, vermithor and vhagar a render node', () => { + // measured 2026-08-10: meleys is AMD, syrax is Atom, caraxes is ARM; balerion's iGPU measured 2026-11-26 + expect(names(HOSTS.filter(({ has_gpu }) => has_gpu))).toEqual([ + 'balerion', + 'vermithor', + 'vhagar', + ]) }) it('configures the three docker hosts', () => { diff --git a/apps/fleet-monitor/src/config.ts b/apps/fleet-monitor/src/config.ts index 84c32b7d..6c831e29 100644 --- a/apps/fleet-monitor/src/config.ts +++ b/apps/fleet-monitor/src/config.ts @@ -81,11 +81,12 @@ export const host = ({ // Measured 2026-08-10, GPU absence re-verified 2026-08-11. // -// has_gpu is a permanent property, not a pending driver fix. Only vermithor -// (Celeron J3455) and vhagar (Celeron J4125) expose a render node. meleys has -// no /dev/dri, an empty /sys/class/drm and no amdgpu module because Synology -// does not enable the R1600's Vega iGPU; syrax is an Atom C3538 with no iGPU; -// caraxes is ARMv8 with 1.6 GB. +// has_gpu is a permanent property, not a pending driver fix. Of the Synology +// boxes only vermithor (Celeron J3455) and vhagar (Celeron J4125) expose a +// render node; balerion's is covered below. meleys has no /dev/dri, an empty +// /sys/class/drm and no amdgpu module because Synology does not enable the +// R1600's Vega iGPU; syrax is an Atom C3538 with no iGPU; caraxes is ARMv8 +// with 1.6 GB. // // Core count is deliberately not a field here. /proc/stat already reports one // row per cpu on every tick, so the collector observes it; declaring it as well @@ -112,8 +113,11 @@ export const host = ({ // verification off. The owner token still authorizes every request. // // balerion is a UGreen NAS (UGOS, not DSM) added 2026-11-23 as the media store -// Meleys mounts over CIFS. Plex stays on Meleys, so it has no plex_url; Docker -// and GPU are unprobed until ssh is enabled there and they can be measured. +// Meleys mounts over CIFS. Plex stays on Meleys, so it has no plex_url. +// Measured 2026-11-26, once ssh was enabled there: a Pentium Gold 8505 whose +// Intel iGPU exposes a render node, so has_gpu is true. Docker is installed +// but listens on its local unix socket only, nothing on :2375, so docker +// stays false until a socket proxy is deployed, as on the other hosts. const DOCKER_PORT = 2375 const PLEX_PORT = 32400 @@ -156,7 +160,7 @@ const FLEET: readonly Readonly<{ { name: 'caraxes', has_gpu: false, docker: false, plex: 'http', console: 'dsm' }, { name: 'syrax', has_gpu: false, docker: false, plex: 'http', console: 'dsm' }, { name: 'vhagar', has_gpu: true, docker: true, plex: 'https', console: 'dsm' }, - { name: 'balerion', has_gpu: false, docker: false, plex: null, console: 'ugos' }, + { name: 'balerion', has_gpu: true, docker: false, plex: null, console: 'ugos' }, ] /**