Update storage-overview.tsx

This commit is contained in:
MacRimi
2025-10-16 21:19:03 +02:00
parent 598cbc4d11
commit 20e942dccd

View File

@@ -399,12 +399,14 @@ export function StorageOverview() {
const totalProxmoxUsed =
proxmoxStorage && proxmoxStorage.storage
? proxmoxStorage.storage
.filter((storage) => storage.total > 0 && storage.status.toLowerCase() === "active")
.filter(
(storage) => storage && storage.total > 0 && storage.status && storage.status.toLowerCase() === "active",
)
.reduce((sum, storage) => sum + storage.used, 0)
: 0
const usagePercent =
storageData.total > 0 ? ((totalProxmoxUsed / (storageData.total * 1024)) * 100).toFixed(2) : "0.00"
storageData && storageData.total > 0 ? ((totalProxmoxUsed / (storageData.total * 1024)) * 100).toFixed(2) : "0.00"
if (loading) {
return (
@@ -511,7 +513,9 @@ export function StorageOverview() {
</CardHeader>
<CardContent>
<div className="space-y-4">
{proxmoxStorage.storage.map((storage) => (
{proxmoxStorage.storage
.filter((storage) => storage && storage.name && storage.total > 0)
.map((storage) => (
<div key={storage.name} className="border rounded-lg p-4">
<div className="flex items-center justify-between mb-3">
{/* Desktop: Icon + Name + Badge tipo alineados horizontalmente */}