Spaces:
Running
Running
fix uptime showing undefined on dashboard
Browse filesinitialData for / route was missing uptimeHuman — only /health and /status
computed it. Add uptime calculation to the dashboard render path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- health-server.js +2 -0
health-server.js
CHANGED
|
@@ -2090,8 +2090,10 @@ const server = http.createServer((req, res) => {
|
|
| 2090 |
if (pathname === "/" || pathname === "") {
|
| 2091 |
void (async () => {
|
| 2092 |
const postiz = await checkPostizHealth();
|
|
|
|
| 2093 |
const initialData = {
|
| 2094 |
postizRunning: postiz.status === "running",
|
|
|
|
| 2095 |
keepalive: getKeepaliveStatus(),
|
| 2096 |
sync: readSyncStatus(),
|
| 2097 |
};
|
|
|
|
| 2090 |
if (pathname === "/" || pathname === "") {
|
| 2091 |
void (async () => {
|
| 2092 |
const postiz = await checkPostizHealth();
|
| 2093 |
+
const uptime = Math.floor((Date.now() - startTime) / 1000);
|
| 2094 |
const initialData = {
|
| 2095 |
postizRunning: postiz.status === "running",
|
| 2096 |
+
uptimeHuman: formatUptime(uptime),
|
| 2097 |
keepalive: getKeepaliveStatus(),
|
| 2098 |
sync: readSyncStatus(),
|
| 2099 |
};
|