somratpro commited on
Commit
87766ca
·
1 Parent(s): f20876b

Fix: add local time display for sync status in dashboard

Browse files
Files changed (1) hide show
  1. health-server.js +9 -0
health-server.js CHANGED
@@ -1158,6 +1158,9 @@ function renderDashboard(data) {
1158
  value: toneBadge(syncStatus.toUpperCase(), syncTone),
1159
  detail: backupDetail,
1160
  tone: syncTone,
 
 
 
1161
  }),
1162
  renderTile({
1163
  title: "Keep Awake",
@@ -1303,6 +1306,12 @@ function renderDashboard(data) {
1303
  } catch(e) {}
1304
  }
1305
  setInterval(refresh, 15000);
 
 
 
 
 
 
1306
  </script>
1307
  </body>
1308
  </html>`;
 
1158
  value: toneBadge(syncStatus.toUpperCase(), syncTone),
1159
  detail: backupDetail,
1160
  tone: syncTone,
1161
+ meta: data.sync?.timestamp
1162
+ ? `<span class="local-time" data-iso="${data.sync.timestamp}"></span>`
1163
+ : "",
1164
  }),
1165
  renderTile({
1166
  title: "Keep Awake",
 
1306
  } catch(e) {}
1307
  }
1308
  setInterval(refresh, 15000);
1309
+ document.querySelectorAll('.local-time').forEach(el => {
1310
+ const date = new Date(el.getAttribute('data-iso'));
1311
+ if (!isNaN(date)) {
1312
+ el.textContent = 'At ' + date.toLocaleTimeString();
1313
+ }
1314
+ });
1315
  </script>
1316
  </body>
1317
  </html>`;