Update AppImage

This commit is contained in:
MacRimi
2025-11-07 12:54:10 +01:00
parent 7d5726be50
commit 8dc2b833f4
6 changed files with 17 additions and 57 deletions

View File

@@ -96,10 +96,6 @@ interface ProxmoxStorageData {
}>
}
interface SystemOverviewProps {
isActive?: boolean
}
const fetchSystemData = async (): Promise<SystemData | null> => {
try {
const apiUrl = getApiUrl("/api/system")
@@ -223,7 +219,7 @@ const fetchProxmoxStorageData = async (): Promise<ProxmoxStorageData | null> =>
}
}
export function SystemOverview({ isActive = true }: SystemOverviewProps) {
export function SystemOverview() {
const [systemData, setSystemData] = useState<SystemData | null>(null)
const [vmData, setVmData] = useState<VMData[]>([])
const [storageData, setStorageData] = useState<StorageData | null>(null)
@@ -235,10 +231,6 @@ export function SystemOverview({ isActive = true }: SystemOverviewProps) {
const [networkTotals, setNetworkTotals] = useState<{ received: number; sent: number }>({ received: 0, sent: 0 })
useEffect(() => {
if (!isActive) {
return
}
const fetchData = async () => {
try {
setLoading(true)
@@ -261,7 +253,6 @@ export function SystemOverview({ isActive = true }: SystemOverviewProps) {
}
}
// Initial fetch
fetchData()
const systemInterval = setInterval(() => {
@@ -270,11 +261,10 @@ export function SystemOverview({ isActive = true }: SystemOverviewProps) {
})
}, 10000)
// Clean up interval when component unmounts or becomes inactive
return () => {
clearInterval(systemInterval)
}
}, [isActive]) // Add isActive as dependency
}, [])
useEffect(() => {
const fetchVMs = async () => {
@@ -731,11 +721,7 @@ export function SystemOverview({ isActive = true }: SystemOverviewProps) {
</div>
<div className="pt-3 border-t border-border">
<NetworkTrafficChart
timeframe={networkTimeframe}
onTotalsCalculated={setNetworkTotals}
isActive={isActive}
/>
<NetworkTrafficChart timeframe={networkTimeframe} onTotalsCalculated={setNetworkTotals} />
</div>
</div>
) : (