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}