diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index 9de2311..03c6f82 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -170,13 +170,14 @@ export default function Hardware() { const storageSummary = hardwareData.storage_devices.reduce( (acc, disk) => { - const sizeMatch = disk.size.match(/(\d+\.?\d*)\s*([KMGT]B)/) + const sizeMatch = disk.size.match(/(\d+\.?\d*)\s*([KMGT]?B)/) if (sizeMatch) { let sizeInGB = Number.parseFloat(sizeMatch[1]) const unit = sizeMatch[2] - if (unit === "TB") sizeInGB *= 1024 - else if (unit === "MB") sizeInGB /= 1024 - else if (unit === "KB") sizeInGB /= 1024 * 1024 + if (unit === "TB" || unit === "T") sizeInGB *= 1024 + else if (unit === "GB" || unit === "G") sizeInGB *= 1 + else if (unit === "MB" || unit === "M") sizeInGB /= 1024 + else if (unit === "KB" || unit === "K") sizeInGB /= 1024 * 1024 acc.totalCapacity += sizeInGB } @@ -330,7 +331,7 @@ export default function Hardware() { )} - {/* Storage Summary - Simplified */} + {/* Storage Summary - Improved */} {hardwareData.storage_devices.length > 0 && (
@@ -349,7 +350,7 @@ export default function Hardware() { {storageSummary.ssd > 0 && (
-

SSD Drives

+

SSD/NVMe Drives

{storageSummary.ssd}

)} @@ -368,67 +369,6 @@ export default function Hardware() { )} - {/* Storage Devices */} - {hardwareData.storage_devices.length > 0 && ( - -
- -

Storage Devices

- - {hardwareData.storage_devices.length} devices - -
- -
- {hardwareData.storage_devices.map((disk, index) => ( - -
-
-
- /dev/{disk.name} - {getHealthBadge(disk.health)} - {disk.rotation_rate === 0 && ( - - SSD - - )} - {disk.rotation_rate > 0 && ( - - {disk.rotation_rate} RPM - - )} -
- -
-
- Model - {disk.model} -
-
- Size - {disk.size} -
- {disk.temperature > 0 && ( -
- Temperature - {disk.temperature}°C -
- )} - {disk.power_on_hours > 0 && ( -
- Power On Hours - {disk.power_on_hours.toLocaleString()}h -
- )} -
-
-
-
- ))} -
-
- )} - {/* Graphics Cards */} {hardwareData.graphics_cards.length > 0 && ( @@ -505,80 +445,53 @@ export default function Hardware() { )} - {/* Network Cards */} - {hardwareData.network_cards.length > 0 && ( + {/* Thermal Monitoring */} + {hardwareData.sensors.temperatures.length > 0 && (
- -

Network Cards

- - {hardwareData.network_cards.length} NIC{hardwareData.network_cards.length > 1 ? "s" : ""} - + +

Thermal Monitoring

- {hardwareData.network_cards.map((nic, index) => ( - + {hardwareData.sensors.temperatures.map((sensor, index) => ( +
- {nic.name} - - {nic.type} - + {sensor.name} + + {sensor.current.toFixed(1)}°C +
- + +
))}
)} - {/* Sensors (Temperature & Fans) */} - {hasSensors && ( + {/* Fan Monitoring */} + {hardwareData.sensors.fans.length > 0 && (
- -

Thermal & Fan Monitoring

+ +

Fan Monitoring

-
- {/* Temperatures */} - {hardwareData.sensors.temperatures.length > 0 && ( -
-

Temperatures

-
- {hardwareData.sensors.temperatures.map((sensor, index) => ( -
-
- {sensor.name} - - {sensor.current.toFixed(1)}°C - -
- -
- ))} +
+ {hardwareData.sensors.fans.map((fan, index) => ( +
+
+ + {fan.name}
+ {fan.current_rpm} RPM
- )} - - {/* Fans */} - {hardwareData.sensors.fans.length > 0 && ( -
-

Fans

-
- {hardwareData.sensors.fans.map((fan, index) => ( -
-
- - {fan.name} -
- {fan.current_rpm} RPM -
- ))} -
-
- )} + ))}
)} diff --git a/AppImage/components/proxmox-dashboard.tsx b/AppImage/components/proxmox-dashboard.tsx index f3769f7..d6b85f0 100644 --- a/AppImage/components/proxmox-dashboard.tsx +++ b/AppImage/components/proxmox-dashboard.tsx @@ -310,48 +310,72 @@ export function ProxmoxDashboard() {
- setMobileMenuOpen(false)} - className="w-full justify-start data-[state=active]:bg-primary data-[state=active]:text-primary-foreground" + + + + + +