somratpro Claude Sonnet 4.6 commited on
Commit
5532c91
·
1 Parent(s): 4a7c78e

fix uptime showing undefined on dashboard

Browse files

initialData 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>

Files changed (1) hide show
  1. 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
  };