diff --git a/frontend-modern/src/components/Storage/Storage.tsx b/frontend-modern/src/components/Storage/Storage.tsx index cef33217f..1a6edbb85 100644 --- a/frontend-modern/src/components/Storage/Storage.tsx +++ b/frontend-modern/src/components/Storage/Storage.tsx @@ -123,20 +123,6 @@ const Storage: Component = () => { // setSortDirection('asc'); }; - const getTotalByNode = (storages: StorageType[]) => { - const totals = { used: 0, total: 0, free: 0 }; - storages.forEach(s => { - totals.used += s.used || 0; - totals.total += s.total || 0; - totals.free += s.free || 0; - }); - return totals; - }; - - const calculateOverallUsage = (storages: StorageType[]) => { - const totals = getTotalByNode(storages); - return totals.total > 0 ? (totals.used / totals.total * 100) : 0; - }; // Handle keyboard shortcuts let searchInputRef: HTMLInputElement | undefined; @@ -281,7 +267,7 @@ const Storage: Component = () => { {/* Group Header */} - + { {groupName} - - {getTotalByNode(storages).total > 0 && ( - - {formatBytes(getTotalByNode(storages).used)} / {formatBytes(getTotalByNode(storages).total)} ({calculateOverallUsage(storages).toFixed(1)}%) - - )} - diff --git a/internal/mock/generator.go b/internal/mock/generator.go index afbdf3565..92b0673d0 100644 --- a/internal/mock/generator.go +++ b/internal/mock/generator.go @@ -228,13 +228,25 @@ func generateNode(name string, highLoad bool, config MockConfig) models.Node { coreCounts := []int{4, 8, 12, 16, 24, 32, 48, 64} cores := coreCounts[rand.Intn(len(coreCounts))] + // Generate realistic version information + pveVersions := []string{"8.2.4", "8.2.2", "8.1.10", "8.0.12", "7.4-18"} + kernelVersions := []string{ + "6.8.12-1-pve", + "6.8.8-2-pve", + "6.5.13-5-pve", + "6.2.16-20-pve", + "5.15.143-1-pve", + } + return models.Node{ - Name: name, - Instance: "", // Set by generateNodes based on cluster/standalone - Type: "pve", - Status: "online", - Uptime: int64(86400 * (1 + rand.Intn(30))), // 1-30 days - CPU: cpu, + Name: name, + Instance: "", // Set by generateNodes based on cluster/standalone + Type: "pve", + Status: "online", + Uptime: int64(86400 * (1 + rand.Intn(30))), // 1-30 days + CPU: cpu, + PVEVersion: pveVersions[rand.Intn(len(pveVersions))], + KernelVersion: kernelVersions[rand.Intn(len(kernelVersions))], Memory: models.Memory{ Total: totalMem * 1024 * 1024 * 1024, // Convert to bytes Used: usedMem * 1024 * 1024 * 1024,