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() { -
-
Node Storage
-
- Used: - {storageData.used.toFixed(1)} GB + {vmLxcStorages && vmLxcStorages.length > 0 ? ( +
+
VM/LXC Storage
+
+ Used: + {formatStorage(vmLxcStorageUsed)} +
+
+ Available: + + {formatStorage(vmLxcStorageAvailable)} + +
+ +
+ + {formatStorage(vmLxcStorageUsed)} / {formatStorage(vmLxcStorageTotal)} + + {vmLxcStoragePercent.toFixed(1)}% +
+ {vmLxcStorages.length > 1 && ( +
+ {vmLxcStorages.length} storage volume{vmLxcStorages.length > 1 ? "s" : ""} +
+ )}
-
- Available: - {storageData.available.toFixed(1)} GB + ) : ( +
+
VM/LXC Storage
+
No VM/LXC storage configured
- -
- - {storageData.used.toFixed(1)} / {(storageData.used + storageData.available).toFixed(1)} GB - - - {((storageData.used / (storageData.used + storageData.available)) * 100).toFixed(1)}% - -
-
+ )} {localStorage && (