mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Adding server uptime to status pages.
This commit is contained in:
parent
b408d11ea1
commit
d4f1cfb859
6 changed files with 107 additions and 3 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue