diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index 03c6f82..13056f1 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -170,15 +170,15 @@ 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]) + let sizeInTB = Number.parseFloat(sizeMatch[1]) const unit = sizeMatch[2] - 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 + if (unit === "TB" || unit === "T") sizeInTB *= 1 + else if (unit === "GB" || unit === "G") sizeInTB /= 1024 + else if (unit === "MB" || unit === "M") sizeInTB /= 1024 * 1024 + else if (unit === "KB" || unit === "K") sizeInTB /= 1024 * 1024 * 1024 + acc.totalCapacity += sizeInTB } if (disk.rotation_rate === 0) acc.ssd++ @@ -331,7 +331,7 @@ export default function Hardware() { )} - {/* Storage Summary - Improved */} + {/* Storage Summary - Fixed to show TB */} {hardwareData.storage_devices.length > 0 && (
@@ -345,7 +345,11 @@ export default function Hardware() {

Total Capacity

-

{storageSummary.totalCapacity.toFixed(1)} GB

+

+ {storageSummary.totalCapacity >= 1 + ? `${storageSummary.totalCapacity.toFixed(1)} TB` + : `${(storageSummary.totalCapacity * 1024).toFixed(1)} GB`} +

{storageSummary.ssd > 0 && ( @@ -398,7 +402,9 @@ export default function Hardware() { {gpu.temperature && gpu.temperature > 0 && (
Temperature - {gpu.temperature}°C + + {gpu.temperature}°C +
)} {gpu.power_draw && ( diff --git a/AppImage/components/proxmox-dashboard.tsx b/AppImage/components/proxmox-dashboard.tsx index d6b85f0..3a92c1e 100644 --- a/AppImage/components/proxmox-dashboard.tsx +++ b/AppImage/components/proxmox-dashboard.tsx @@ -45,6 +45,7 @@ export function ProxmoxDashboard() { const [isServerConnected, setIsServerConnected] = useState(true) const [componentKey, setComponentKey] = useState(0) const [mobileMenuOpen, setMobileMenuOpen] = useState(false) + const [activeTab, setActiveTab] = useState("overview") const fetchSystemData = useCallback(async () => { console.log("[v0] Fetching system data from Flask server...") @@ -259,7 +260,7 @@ export function ProxmoxDashboard() {
- + { - const overviewTab = document.querySelector('[value="overview"]') as HTMLButtonElement - overviewTab?.click() + setActiveTab("overview") setMobileMenuOpen(false) }} className="w-full justify-start" @@ -324,8 +324,7 @@ export function ProxmoxDashboard() {