Add RAM usage in GB and swap metrics to agent, server, UI and CSV export

This commit is contained in:
2026-07-17 17:10:47 +07:00
parent 513b8ede84
commit 76f74201e5
12 changed files with 272 additions and 35 deletions
+11 -1
View File
@@ -127,12 +127,22 @@ def computer_page(computer_id: int, request: Request, db: Session = Depends(get_
"local_ip": h.local_ip,
"cpu_percent": h.cpu_percent,
"ram_percent": h.ram_percent,
"ram_total_gb": h.ram_total_gb,
"ram_used_gb": h.ram_used_gb,
"ram_available_gb": h.ram_available_gb,
"swap_total_gb": h.swap_total_gb,
"swap_used_gb": h.swap_used_gb,
"swap_free_gb": h.swap_free_gb,
"swap_percent": h.swap_percent,
"cpu_temp": h.cpu_temp,
"processes": h.processes or [],
"sessions": h.sessions or [],
})
if not latest_sessions and h.sessions:
# Take the most recent heartbeat that actually has session data
for h in reversed(heartbeats):
if h.sessions:
latest_sessions = h.sessions
break
return templates.TemplateResponse(
"computer.html",