diff --git a/AppImage/components/system-overview.tsx b/AppImage/components/system-overview.tsx index 833f02b..4f8ade5 100644 --- a/AppImage/components/system-overview.tsx +++ b/AppImage/components/system-overview.tsx @@ -401,6 +401,23 @@ export function SystemOverview() { const localStorage = proxmoxStorageData?.storage.find((s) => s.name === "local") + const vmLxcStorages = proxmoxStorageData?.storage.filter( + (s) => + // Include only local storage types that can host VMs/LXCs + (s.type === "lvm" || s.type === "lvmthin" || s.type === "zfspool" || s.type === "btrfs" || s.type === "dir") && + // Exclude network storage + s.type !== "nfs" && + s.type !== "cifs" && + s.type !== "iscsi" && + // Exclude the "local" storage (used for ISOs/templates) + s.name !== "local", + ) + + const vmLxcStorageTotal = vmLxcStorages?.reduce((acc, s) => acc + s.total, 0) || 0 + const vmLxcStorageUsed = vmLxcStorages?.reduce((acc, s) => acc + s.used, 0) || 0 + const vmLxcStorageAvailable = vmLxcStorages?.reduce((acc, s) => acc + s.available, 0) || 0 + const vmLxcStoragePercent = vmLxcStorageTotal > 0 ? (vmLxcStorageUsed / vmLxcStorageTotal) * 100 : 0 + const getLoadStatus = (load: number, cores: number) => { if (load < cores) { return { status: "Normal", color: "bg-green-500/10 text-green-500 border-green-500/20" } @@ -542,29 +559,38 @@ export function SystemOverview() { -