mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-10-03 16:46:18 +00:00
Update AppImage
This commit is contained in:
@@ -104,7 +104,7 @@ export function ProxmoxDashboard() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchSystemData()
|
fetchSystemData()
|
||||||
const interval = setInterval(fetchSystemData, 5000)
|
const interval = setInterval(fetchSystemData, 10000) // Updated interval to 10 seconds
|
||||||
return () => clearInterval(interval)
|
return () => clearInterval(interval)
|
||||||
}, [fetchSystemData])
|
}, [fetchSystemData])
|
||||||
|
|
||||||
|
@@ -178,12 +178,7 @@ export function SystemOverview() {
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
setError(null)
|
setError(null)
|
||||||
|
|
||||||
const [systemResult, vmResult, storageResult, networkResult] = await Promise.all([
|
const systemResult = await fetchSystemData()
|
||||||
fetchSystemData(),
|
|
||||||
fetchVMData(),
|
|
||||||
fetchStorageData(),
|
|
||||||
fetchNetworkData(),
|
|
||||||
])
|
|
||||||
|
|
||||||
if (!systemResult) {
|
if (!systemResult) {
|
||||||
setError("Flask server not available. Please ensure the server is running.")
|
setError("Flask server not available. Please ensure the server is running.")
|
||||||
@@ -192,11 +187,8 @@ export function SystemOverview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setSystemData(systemResult)
|
setSystemData(systemResult)
|
||||||
setVmData(vmResult)
|
|
||||||
setStorageData(storageResult)
|
|
||||||
setNetworkData(networkResult)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("[v0] Error fetching data:", err)
|
console.error("[v0] Error fetching system data:", err)
|
||||||
setError("Failed to connect to Flask server. Please check your connection.")
|
setError("Failed to connect to Flask server. Please check your connection.")
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
@@ -205,12 +197,56 @@ export function SystemOverview() {
|
|||||||
|
|
||||||
fetchData()
|
fetchData()
|
||||||
|
|
||||||
const interval = setInterval(() => {
|
const systemInterval = setInterval(() => {
|
||||||
fetchData()
|
fetchSystemData().then((data) => {
|
||||||
}, 60000) // Update every 60 seconds instead of 30
|
if (data) setSystemData(data)
|
||||||
|
})
|
||||||
|
}, 10000)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
clearInterval(interval)
|
clearInterval(systemInterval)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchVMs = async () => {
|
||||||
|
const vmResult = await fetchVMData()
|
||||||
|
setVmData(vmResult)
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchVMs()
|
||||||
|
const vmInterval = setInterval(fetchVMs, 15000)
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearInterval(vmInterval)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchStorage = async () => {
|
||||||
|
const storageResult = await fetchStorageData()
|
||||||
|
setStorageData(storageResult)
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchStorage()
|
||||||
|
const storageInterval = setInterval(fetchStorage, 15000)
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearInterval(storageInterval)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchNetwork = async () => {
|
||||||
|
const networkResult = await fetchNetworkData()
|
||||||
|
setNetworkData(networkResult)
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchNetwork()
|
||||||
|
const networkInterval = setInterval(fetchNetwork, 15000)
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearInterval(networkInterval)
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
@@ -424,7 +424,13 @@ def get_network_info():
|
|||||||
net_if_stats = psutil.net_if_stats()
|
net_if_stats = psutil.net_if_stats()
|
||||||
|
|
||||||
for interface_name, interface_addresses in net_if_addrs.items():
|
for interface_name, interface_addresses in net_if_addrs.items():
|
||||||
if interface_name == 'lo': # Skip loopback
|
# Skip loopback
|
||||||
|
if interface_name == 'lo':
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Skip virtual interfaces that are not bridges
|
||||||
|
# Keep: physical interfaces (enp*, eth*, wlan*) and bridges (vmbr*, br*)
|
||||||
|
if not (interface_name.startswith(('enp', 'eth', 'wlan', 'vmbr', 'br'))):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
interface_info = {
|
interface_info = {
|
||||||
|
Reference in New Issue
Block a user