Show the same capacity bar for RAM and disk space
Rust development slice / linux (push) Failing after 7s

This commit is contained in:
2026-11-18 18:47:46 +01:00
parent 7006ce7420
commit 6ed57c4d0b
5 changed files with 17 additions and 12 deletions
+6 -7
View File
@@ -85,14 +85,13 @@ function Presence({ d }: { d: RecordValue }) {
</span>
);
}
function Storage({ d }: { d: RecordValue }) {
const free = d.disk_free_bytes,
total = d.disk_total_bytes;
function Capacity({ free, total }: { free: unknown; total: unknown }) {
return (
<>
<span>{capacity(free, total)}</span>
{typeof free === 'number' &&
typeof total === 'number' &&
Number.isFinite(total) &&
free >= 0 &&
free <= total &&
total > 0 && (
@@ -601,11 +600,11 @@ export function Devices({
<small>Zuletzt {time(d.last_contact_at)}</small>
)}
</td>
<td data-label="Speicher frei / gesamt" className="storage">
<Storage d={d} />
<td data-label="Speicher frei / gesamt" className="capacity-cell">
<Capacity free={d.disk_free_bytes} total={d.disk_total_bytes} />
</td>
<td data-label="RAM frei / gesamt" title={measuredAt(d.ram_observed_at)}>
{capacity(d.ram_available_bytes, d.ram_total_bytes)}
<td data-label="RAM frei / gesamt" className="capacity-cell" title={measuredAt(d.ram_observed_at)}>
<Capacity free={d.ram_available_bytes} total={d.ram_total_bytes} />
</td>
<td data-label="CPU">
{model.primary}
+1 -1
View File
@@ -98,7 +98,7 @@ section.fleet { padding:0; overflow:hidden; }
.fleet-table td[data-label="Type"] { overflow-wrap:anywhere; }
.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 .storage { font-variant-numeric:tabular-nums; }
.fleet-table .capacity-cell { font-variant-numeric:tabular-nums; }
.capacity-track { display:block; width:min(90px,100%); border-radius:2px; background:#e1ebe6; height:4px; margin-top:6px; overflow:hidden; }
.capacity-track i { display:block; height:100%; background:#659d84; }
.presence { display:inline-flex; align-items:center; gap:5px; border-radius:20px; padding:2px 8px; background:#edf1ef; color:#4d5f59; font-size:.8rem; font-weight:650; }