Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions apps/admin-portal/src/components/IconTile/IconTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -19,6 +20,7 @@ const TONE_CLASS: Record<IconTileTone, string> = {
muted: styles.muted,
ok: styles.ok,
series: styles.series,
warn: styles.warn,
}

const SIZE_CLASS: Record<IconTileSize, string> = {
Expand Down
30 changes: 26 additions & 4 deletions apps/admin-portal/src/pages/Fleet/Fleet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<HostCard host={card} />)

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()
})

Expand Down Expand Up @@ -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(
<HostCard
host={{
...card,
status: 'warn',
metrics_stale: true,
stalest_family: 'disk',
stalest_family_age_seconds: 604_800,
}}
/>,
)

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(<HostCard host={{ ...card, status: 'ok', metrics_stale: false }} />)

Expand Down
40 changes: 16 additions & 24 deletions apps/admin-portal/src/pages/Fleet/HostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HostStatus, string | null> = {
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<HostStatus, { name: IconName; tone: IconTileTone } | null> = {
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<HostStatus, { label: string; icon: IconName; tone: IconTileTone }> = {
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
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -270,12 +264,10 @@ export const HostCard = ({ host, className }: HostCardProps) => {
<p className={styles.ip}>{host.ip}</p>
{/* status is stated in text, never by color alone: the tile restates
the word beside it and is hidden from the accessibility tree */}
{!!statusText && (
<p className={staleStatus ? `${styles.status} ${styles.statusStale}` : styles.status}>
{!!mark && <IconTile name={mark.name} tone={mark.tone} size="sm" />}
{statusText}
</p>
)}
<p className={staleStatus ? `${styles.status} ${styles.statusStale}` : styles.status}>
<IconTile name={status.icon} tone={status.tone} size="sm" />
{statusText}
</p>
</header>

<div className={styles.body}>
Expand Down
10 changes: 7 additions & 3 deletions apps/fleet-monitor/src/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
20 changes: 12 additions & 8 deletions apps/fleet-monitor/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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' },
]

/**
Expand Down
Loading