mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-10-11 12:26:18 +00:00
Update virtual-machines.tsx
This commit is contained in:
@@ -286,23 +286,19 @@ export function VirtualMachines() {
|
|||||||
return (safeVMData.reduce((sum, vm) => sum + (vm.maxmem || 0), 0) / 1024 ** 3).toFixed(1)
|
return (safeVMData.reduce((sum, vm) => sum + (vm.maxmem || 0), 0) / 1024 ** 3).toFixed(1)
|
||||||
}, [safeVMData])
|
}, [safeVMData])
|
||||||
|
|
||||||
const { data: overviewData } = useSWR("/api/overview", fetcher, {
|
const { data: systemData } = useSWR("/api/system", fetcher, {
|
||||||
refreshInterval: 30000,
|
refreshInterval: 30000,
|
||||||
revalidateOnFocus: false,
|
revalidateOnFocus: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log("[v0] Overview data:", overviewData)
|
|
||||||
console.log("[v0] Total allocated memory GB:", totalAllocatedMemoryGB)
|
|
||||||
|
|
||||||
const physicalMemoryGB = useMemo(() => {
|
const physicalMemoryGB = useMemo(() => {
|
||||||
if (overviewData && overviewData.memory) {
|
if (systemData && systemData.memory_total) {
|
||||||
const physicalGB = (overviewData.memory.total / 1024 ** 3).toFixed(1)
|
console.log("[v0] Physical memory GB:", systemData.memory_total)
|
||||||
console.log("[v0] Physical memory GB:", physicalGB)
|
return systemData.memory_total.toFixed(1)
|
||||||
return physicalGB
|
|
||||||
}
|
}
|
||||||
console.log("[v0] No physical memory data available")
|
console.log("[v0] No physical memory data available")
|
||||||
return null
|
return null
|
||||||
}, [overviewData])
|
}, [systemData])
|
||||||
|
|
||||||
const isMemoryOvercommit = useMemo(() => {
|
const isMemoryOvercommit = useMemo(() => {
|
||||||
if (physicalMemoryGB) {
|
if (physicalMemoryGB) {
|
||||||
|
Reference in New Issue
Block a user