Update AppImage

This commit is contained in:
MacRimi
2025-10-26 22:11:02 +01:00
parent 610e08e690
commit 2d4833d199
2 changed files with 99 additions and 49 deletions

View File

@@ -146,31 +146,7 @@ const fetchVMData = async (): Promise<VMData[]> => {
const fetchStorageData = async (): Promise<StorageData | null> => {
try {
const baseUrl = typeof window !== "undefined" ? `${window.location.protocol}//${window.location.hostname}:8008` : ""
const apiUrl = `${baseUrl}/api/storage`
const response = await fetch(apiUrl, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
cache: "no-store",
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
const data = await response.json()
return data
} catch (error) {
return null
}
}
const fetchNetworkData = async (): Promise<NetworkData | null> => {
try {
const baseUrl = typeof window !== "undefined" ? `${window.location.protocol}//${window.location.hostname}:8008` : ""
const apiUrl = `${baseUrl}/api/network`
const apiUrl = `${baseUrl}/api/storage/summary`
const response = await fetch(apiUrl, {
method: "GET",
@@ -217,6 +193,30 @@ const fetchProxmoxStorageData = async (): Promise<ProxmoxStorageData | null> =>
}
}
const fetchNetworkData = async (): Promise<NetworkData | null> => {
try {
const baseUrl = typeof window !== "undefined" ? `${window.location.protocol}//${window.location.hostname}:8008` : ""
const apiUrl = `${baseUrl}/api/network`
const response = await fetch(apiUrl, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
cache: "no-store",
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
const data = await response.json()
return data
} catch (error) {
return null
}
}
export function SystemOverview() {
const [systemData, setSystemData] = useState<SystemData | null>(null)
const [vmData, setVmData] = useState<VMData[]>([])