Adding server uptime to status pages.

This commit is contained in:
Roland 2025-12-26 10:05:13 -07:00
parent b408d11ea1
commit d4f1cfb859
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
6 changed files with 107 additions and 3 deletions

View file

@ -154,3 +154,14 @@ async def get_iostat(request: Request):
# Fallback to direct call
from controller.lib.status import get_iostat_status
return JSONResponse(content=get_iostat_status())
@router.get("/uptime")
async def get_uptime(request: Request):
"""Get system uptime information."""
cached = get_cached_status(request)
if cached and cached.get("uptime_stats"):
return JSONResponse(content=cached["uptime_stats"])
# Fallback to direct call
from controller.lib.status import get_uptime_status
return JSONResponse(content=get_uptime_status())