diff --git a/AppImage/app/layout.tsx b/AppImage/app/layout.tsx index 4ef752f..0fcdcb1 100644 --- a/AppImage/app/layout.tsx +++ b/AppImage/app/layout.tsx @@ -3,7 +3,6 @@ import type { Metadata } from "next" import { GeistSans } from "geist/font/sans" import { GeistMono } from "geist/font/mono" import { ThemeProvider } from "../components/theme-provider" -import { PollingConfigProvider } from "../lib/polling-config" import { Suspense } from "react" import "./globals.css" @@ -38,7 +37,7 @@ export default function RootLayout({ Loading...}> - {children} + {children} diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index 89981d4..53e0b2a 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -21,7 +21,6 @@ import { import useSWR from "swr" import { useState, useEffect } from "react" import { type HardwareData, type GPU, type PCIDevice, type StorageDevice, fetcher } from "../types/hardware" -import { usePollingConfig } from "@/lib/polling-config" const parseLsblkSize = (sizeStr: string | undefined): number => { if (!sizeStr) return 0 @@ -164,38 +163,14 @@ const groupAndSortTemperatures = (temperatures: any[]) => { } export default function Hardware() { - const { intervals } = usePollingConfig() - - // Static data (loaded once on mount): system info, memory, PCI, network/storage summaries const { - data: staticHardwareData, - error: staticError, - isLoading: staticLoading, + data: hardwareData, + error, + isLoading, } = useSWR("/api/hardware", fetcher, { - refreshInterval: 0, // Never refresh automatically - only load once - revalidateOnFocus: false, - revalidateOnReconnect: false, + refreshInterval: 5000, }) - // Dynamic data (temperatures only) - polls at configured interval - const { data: temperatureData, error: tempError } = useSWR<{ temperatures: any[] }>( - "/api/hardware/temperatures", - fetcher, - { - refreshInterval: intervals.hardware, - }, - ) - - const hardwareData = staticHardwareData - ? { - ...staticHardwareData, - temperatures: temperatureData?.temperatures || staticHardwareData.temperatures || [], - } - : null - - const error = staticError || tempError - const isLoading = staticLoading - useEffect(() => { if (hardwareData?.storage_devices) { console.log("[v0] Storage devices data from backend:", hardwareData.storage_devices) diff --git a/AppImage/components/proxmox-dashboard.tsx b/AppImage/components/proxmox-dashboard.tsx index 20a41cc..735213e 100644 --- a/AppImage/components/proxmox-dashboard.tsx +++ b/AppImage/components/proxmox-dashboard.tsx @@ -13,9 +13,6 @@ import { SystemLogs } from "./system-logs" import { OnboardingCarousel } from "./onboarding-carousel" import { HealthStatusModal } from "./health-status-modal" import { getApiUrl } from "../lib/api-config" -import { usePollingConfig, INTERVAL_OPTIONS } from "@/lib/polling-config" -import { Label } from "./ui/label" -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select" import { RefreshCw, AlertTriangle, @@ -69,7 +66,6 @@ export function ProxmoxDashboard() { const [showNavigation, setShowNavigation] = useState(true) const [lastScrollY, setLastScrollY] = useState(0) const [showHealthModal, setShowHealthModal] = useState(false) - const { intervals, updateInterval } = usePollingConfig() const fetchSystemData = useCallback(async () => { console.log("[v0] Fetching system data from Flask server...") @@ -620,116 +616,6 @@ export function ProxmoxDashboard() { -
-

Polling Intervals

-

- Configure how frequently each section updates its data. Lower values provide more real-time data - but increase server load. -

-
-
-
- -

Update frequency for storage metrics

-
- -
- -
-
- -

Update frequency for network metrics

-
- -
- -
-
- -

Update frequency for VM/LXC data

-
- -
- -
-
- -

Update frequency for temperature sensors only

-
- -
-
-

- Note: Hardware static information (System Info, Memory Modules, PCI Devices, - Network/Storage Summaries) is loaded only once when entering the Hardware page and does not - refresh automatically. -

-
-

About