feat(daemon): report host uptime, not only the daemon's process age

The status tile labelled "uptime" showed the age of the daemon *process*
(`/info.uptimeMs`), and `/info` was fetched once with a 30 s staleTime and no
refetch interval, so the figure also froze: on a box five days up, a
`pi2 update` restart made the tile read "3m" and it never moved again.

`os.uptime()` is now sampled with the other host figures and served as
`system.hostUptimeSec` — which the 3 s `/resources` poll already refreshes —
plus an additive `/info.hostUptimeMs`. The tile renders it through a
`LiveUptime` label that anchors the reported snapshot once and ticks locally,
so the counter advances without a refetch and cannot rewind on a re-render.
The daemon's own process age stays in the server card, relabelled
`status.daemonUptime`, next to the `pid`/`daemonId` that give it meaning.
This commit is contained in:
yuez committed 2026-10-30 16:18:48 +08:00
1 parent 01fd7b9922
commit 2f2f1bb518
16 files changed
+204 -10

No files matched your search

+2
View File
@@ -483,6 +483,8 @@ describe("HTTP API", () => {
cpu: 42,
mem: 25,
disk: 25,
// Host uptime is additive and independent of `uptimeMs` (process age).
hostUptimeMs: 432_000_000,
}));
});