feat: show last update check timestamp on dashboard
This commit is contained in:
@@ -86,10 +86,20 @@ def model_upgrades() -> list[dict]:
|
|||||||
return out
|
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:
|
def updates() -> dict:
|
||||||
ups = model_upgrades()
|
ups = model_upgrades()
|
||||||
return {"os": _os_upgradable(), "engine": 1 if _engine_update_available() else 0,
|
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:
|
def _run(cmd: list[str], sudo_password: str | None = None) -> dict:
|
||||||
|
|||||||
-1
File diff suppressed because one or more lines are too long
-350
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -7,8 +7,8 @@
|
|||||||
<link rel="manifest" href="/manifest.webmanifest" />
|
<link rel="manifest" href="/manifest.webmanifest" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<title>Mission Control 2.0</title>
|
<title>Mission Control 2.0</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DbuXer0L.js"></script>
|
<script type="module" crossorigin src="/assets/index-BSlax7wE.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-B7OvRZwV.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-mQ1DUIFB.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ export interface UpdatesResp {
|
|||||||
engine: number
|
engine: number
|
||||||
models: number
|
models: number
|
||||||
model_list: { role: string; title: string; repo: string }[]
|
model_list: { role: string; title: string; repo: string }[]
|
||||||
|
last_check?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConnectTool {
|
export interface ConnectTool {
|
||||||
|
|||||||
@@ -300,9 +300,22 @@ export function DashboardView() {
|
|||||||
{/* Card 2: Updates & Wartung (1 column wide) */}
|
{/* 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="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="space-y-4">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center justify-between flex-wrap gap-2 border-b border-border/20 pb-2">
|
||||||
<ShieldAlert className="h-4.5 w-4.5 text-primary" />
|
<div className="flex items-center gap-2">
|
||||||
<h2 className="text-sm font-semibold tracking-wide uppercase text-foreground">Updates & Pflege</h2>
|
<ShieldAlert className="h-4.5 w-4.5 text-primary" />
|
||||||
|
<h2 className="text-sm font-semibold tracking-wide uppercase text-foreground">Updates & 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>
|
</div>
|
||||||
|
|
||||||
{updates ? (
|
{updates ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user