mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update storage-overview.tsx
This commit is contained in:
@@ -399,12 +399,14 @@ export function StorageOverview() {
|
|||||||
const totalProxmoxUsed =
|
const totalProxmoxUsed =
|
||||||
proxmoxStorage && proxmoxStorage.storage
|
proxmoxStorage && proxmoxStorage.storage
|
||||||
? 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)
|
.reduce((sum, storage) => sum + storage.used, 0)
|
||||||
: 0
|
: 0
|
||||||
|
|
||||||
const usagePercent =
|
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) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
@@ -511,7 +513,9 @@ export function StorageOverview() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="space-y-4">
|
<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 key={storage.name} className="border rounded-lg p-4">
|
||||||
<div className="flex items-center justify-between mb-3">
|
<div className="flex items-center justify-between mb-3">
|
||||||
{/* Desktop: Icon + Name + Badge tipo alineados horizontalmente */}
|
{/* Desktop: Icon + Name + Badge tipo alineados horizontalmente */}
|
||||||
|
|||||||
Reference in New Issue
Block a user