Display Windows fixed volumes individually in both fleet views

This commit is contained in:
2026-11-20 08:53:20 +01:00
parent 9c61f8f2eb
commit 04037c7acf
4 changed files with 55 additions and 4 deletions
+14 -1
View File
@@ -119,6 +119,19 @@ function Capacity({ free, total }: {
);
}
function DiskCapacity({ device }: { device: RecordValue }) {
// Only Windows fleet rows use drive letters. Linux mount inventories remain
// available in the detail view, without expanding every fleet row.
const drives = Array.isArray(device.volumes)
? device.volumes.map(v => record(v)).filter(v => typeof v.name === 'string' && /^[A-Z]:$/.test(v.name)) : [];
if (!drives.length) return <Capacity free={device.disk_free_bytes} total={device.disk_total_bytes} />;
return <>{drives.map(drive => (
<div className="drive-capacity" key={String(drive.name)}>
<strong>{String(drive.name)}</strong>{' '}<Capacity free={drive.free_bytes} total={drive.total_bytes} />
</div>
))}</>;
}
type Target = { customer: string; ids: string[] };
type Props = {
detailPath: string;
@@ -699,7 +712,7 @@ export function Devices({
)}
</td>
<td data-label="Speicher belegt / gesamt" className="capacity-cell">
<Capacity free={d.disk_free_bytes} total={d.disk_total_bytes} />
<DiskCapacity device={d} />
</td>
<td data-label="RAM belegt / gesamt" className="capacity-cell" title={measuredAt(d.ram_observed_at)}>
<Capacity free={d.ram_available_bytes} total={d.ram_total_bytes} />
+1
View File
@@ -105,6 +105,7 @@ section.fleet { padding:0; overflow:hidden; }
.fleet-table input[type=checkbox] { margin:0; }
.host-link { padding:0; background:none; color:var(--accent); text-align:left; font-weight:680; margin:0; overflow-wrap:anywhere; }
.fleet-table .capacity-cell { font-variant-numeric:tabular-nums; }
.drive-capacity + .drive-capacity { margin-top:8px; }
.capacity-track { display:flex; width:min(90px,100%); border-radius:2px; background:#e1ebe6; height:6px; margin-top:6px; overflow:hidden; }
.capacity-used { flex:none; background:#c78980; }
.capacity-free { flex:1; background:#2e7657; }