feat: show last update check timestamp on dashboard
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user