feat: show last update check timestamp on dashboard

This commit is contained in:
Hitonabi
2026-06-26 07:59:42 +02:00
parent 3fa23d16c6
commit 1e879ca3c4
6 changed files with 30 additions and 357 deletions
+11 -1
View File
@@ -86,10 +86,20 @@ def model_upgrades() -> list[dict]:
return out
def _last_apt_update() -> float | None:
for path in ["/var/lib/apt/periodic/update-success-stamp", "/var/cache/apt/pkgcache.bin"]:
if os.path.exists(path):
try:
return os.path.getmtime(path)
except Exception:
pass
return None
def updates() -> dict:
ups = model_upgrades()
return {"os": _os_upgradable(), "engine": 1 if _engine_update_available() else 0,
"models": len(ups), "model_list": ups}
"models": len(ups), "model_list": ups, "last_check": _last_apt_update()}
def _run(cmd: list[str], sudo_password: str | None = None) -> dict: