import { Label as MuLabel, StatusBadge } from "@unlocalhosted/metalui"; import { ConfirmButton } from "@/components/confirm-button"; import { ServerIcon } from "@/components/icons"; import { SettingsSection } from "@/components/metal"; import { ListRow, PlateSection, RowGlyph } from "@/components/settings-plate"; import { Blankslate, RefChip } from "@/components/ui"; import { timeAgo } from "@/lib/format"; import { RUNNER_TOKEN_PREFIX, type Runner } from "@/lib/runners"; /** Registered runners: online, busy or offline, with their labels and machine, each removable. */ export function RunnerList({ runners, deleteAction }: { runners: Runner[]; deleteAction: (runnerId: string) => Promise }) { if (runners.length === 0) { return ( } title="No runners yet"> Register a runner below, then start it on the machine that should run your jobs. ); } return ( {runners.map((r) => ( } title={ <> {r.name} {r.busy ? ( Busy ) : r.online ? ( Idle ) : ( Offline )} {RUNNER_TOKEN_PREFIX}…{r.hint} } meta={ <> {[...r.systemLabels, ...r.labels].map((l) => ( {l} ))} {r.busy ? ( <> Running {r.busy.jobName} in {r.busy.repo} #{r.busy.runNumber} ) : r.lastSeenAt ? ( <> {r.hostname && ( <> {r.hostname} ·{" "} )} Last seen {timeAgo(r.lastSeenAt)} {r.version && <> · v{r.version}} ) : ( "Never connected" )} } > Remove ))} ); }