// Speicher und Statistik in der Übersicht (5.5.0, Commander: „Ist mir zu // leer … wie viel Speicher noch auf dem Server oder auf dem Arbeitsordner // frei ist"). Gemessen im Kern mit fs.statfs — lokal wie auf der Freigabe. import type { SpeicherPlatz, SpeicherStand, Statistik } from '../../gemeinsam/nachrichten' import { FuellBalken, dauerGrob, gbKurz } from '../bausteine' import { speicherLaden } from '../kernverbindung' /** Ab hier wird gewarnt: eine Blu-ray braucht rund 50 GB (Roh + Kompression). */ export const WENIG_FREI_BYTES = 60e9 export const SEHR_WENIG_FREI_BYTES = 20e9 function Platz({ name, platz, hinweis }: { name: string; platz: SpeicherPlatz; hinweis: string }) { const ton = !platz.ok ? 'rot' : platz.freiBytes < SEHR_WENIG_FREI_BYTES ? 'rot' : platz.freiBytes < WENIG_FREI_BYTES ? 'warn' : 'gold' const belegt = platz.ok && platz.gesamtBytes > 0 ? 1 - platz.freiBytes / platz.gesamtBytes : 0 return (
{name} {platz.ok ? `${gbKurz(platz.freiBytes)} frei` : 'nicht messbar'}

{platz.pfad} {platz.ok && ` · ${gbKurz(platz.gesamtBytes)} gesamt`} {!platz.ok && platz.fehler.length > 0 && ` · ${platz.fehler}`}

{hinweis} {platz.ok && ( )}
) } export function SpeicherKarte({ speicher, statistik }: { speicher: SpeicherStand | null; statistik: Statistik | null }) { return (
SPEICHER UND BILANZ
{speicher === null ? (

wird gemessen …

) : (
{speicher.getrennt ? ( <> ) : ( )}
)} {statistik !== null && statistik.discs > 0 && (
0 ? dauerGrob(statistik.dauerS / statistik.fertige) : '—'} zusatz="Rip bis Ablage, im Schnitt" />
)}
) } function Zahl({ label, wert, zusatz }: { label: string; wert: string; zusatz: string }) { return (
{label}
{wert}
{zusatz}
) }