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:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -7,8 +7,8 @@
<link rel="manifest" href="/manifest.webmanifest" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>Mission Control 2.0</title>
<script type="module" crossorigin src="/assets/index-DbuXer0L.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B7OvRZwV.css">
<script type="module" crossorigin src="/assets/index-BSlax7wE.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-mQ1DUIFB.css">
</head>
<body>
<div id="root"></div>
+1
View File
@@ -107,6 +107,7 @@ export interface UpdatesResp {
engine: number
models: number
model_list: { role: string; title: string; repo: string }[]
last_check?: number | null
}
export interface ConnectTool {
+13
View File
@@ -300,10 +300,23 @@ export function DashboardView() {
{/* Card 2: Updates & Wartung (1 column wide) */}
<div className="rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between">
<div className="space-y-4">
<div className="flex items-center justify-between flex-wrap gap-2 border-b border-border/20 pb-2">
<div className="flex items-center gap-2">
<ShieldAlert className="h-4.5 w-4.5 text-primary" />
<h2 className="text-sm font-semibold tracking-wide uppercase text-foreground">Updates &amp; Pflege</h2>
</div>
{updates?.last_check && (
<span className="text-[9px] text-muted-foreground/80 font-mono">
Zuletzt gesucht: {new Date(updates.last_check * 1000).toLocaleString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
hour: "2-digit",
minute: "2-digit"
})}
</span>
)}
</div>
{updates ? (
<div className="space-y-3">