update extra disk indicators in systems table to display max 3 states

This commit is contained in:
henrygd
2025-11-30 12:32:16 -05:00
parent 9804c8a31a
commit 5dfc5f247f

View File

@@ -422,6 +422,13 @@ function DiskCellWithMultiple(info: CellContext<SystemRecord, unknown>) {
return cn("h-full", getIndicatorColor(pct)) return cn("h-full", getIndicatorColor(pct))
} }
// Extra disk indicators (max 3 dots - one per state if any disk exists in range)
const stateColors = [STATUS_COLORS.up, STATUS_COLORS.pending, STATUS_COLORS.down]
const extraDiskIndicators =
status !== SystemStatus.Up
? []
: [...new Set(extraFs.map(([, pct]) => getMeterState(pct)))].sort().map((state) => stateColors[state])
return ( return (
<Tooltip> <Tooltip>
<TooltipTrigger asChild> <TooltipTrigger asChild>
@@ -439,10 +446,10 @@ function DiskCellWithMultiple(info: CellContext<SystemRecord, unknown>) {
style={{ width: `${rootDiskPct}%` }} style={{ width: `${rootDiskPct}%` }}
></span> ></span>
{/* Extra disk indicators */} {/* Extra disk indicators */}
{extraFs.map(([name, pct]) => ( {extraDiskIndicators.map((color) => (
<span <span
key={name} key={color}
className={cn("size-1.5 rounded-full shrink-0 outline-[0.5px] outline-muted", getIndicatorColor(pct))} className={cn("size-1.5 rounded-full shrink-0 outline-[0.5px] outline-muted", color)}
/> />
))} ))}
</span> </span>