Fix: Disk Usage zeigt undefined für TB/PB Werte

Lokale formatBytes Funktion hatte sizes Array nur bis GB.
TB und PB ergänzt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 18:22:24 +02:00
parent fd40c2e899
commit 654df5b98f
+1 -1
View File
@@ -68,7 +68,7 @@ export default function Dashboard() {
const formatBytes = (bytes: number) => { const formatBytes = (bytes: number) => {
if (bytes === 0) return "0 B" if (bytes === 0) return "0 B"
const k = 1024 const k = 1024
const sizes = ["B", "KB", "MB", "GB"] const sizes = ["B", "KB", "MB", "GB", "TB", "PB"]
const i = Math.floor(Math.log(bytes) / Math.log(k)) const i = Math.floor(Math.log(bytes) / Math.log(k))
return (bytes / Math.pow(k, i)).toFixed(1) + " " + sizes[i] return (bytes / Math.pow(k, i)).toFixed(1) + " " + sizes[i]
} }