From 47998fa1f1949c1dfdc1c1c51aaafea8897a2bce Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Tue, 2 Sep 2025 16:17:01 -0600 Subject: [PATCH] Rename last heartbeat column to last seen --- Data/Server/WebUI/src/Device_List.jsx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Data/Server/WebUI/src/Device_List.jsx b/Data/Server/WebUI/src/Device_List.jsx index fe28a0a..0149754 100644 --- a/Data/Server/WebUI/src/Device_List.jsx +++ b/Data/Server/WebUI/src/Device_List.jsx @@ -18,15 +18,21 @@ import { import MoreVertIcon from "@mui/icons-material/MoreVert"; import { DeleteDeviceDialog } from "./Dialogs.jsx"; -function timeSince(tsSec) { +function formatLastSeen(tsSec, offlineAfter = 15) { if (!tsSec) return "unknown"; const now = Date.now() / 1000; - const s = Math.max(0, Math.floor(now - tsSec)); - if (s < 60) return `${s}s`; - const m = Math.floor(s / 60); - if (m < 60) return `${m}m ${s % 60}s`; - const h = Math.floor(m / 60); - return `${h}h ${m % 60}m`; + if (now - tsSec <= offlineAfter) return "Currently Online"; + const d = new Date(tsSec * 1000); + const date = d.toLocaleDateString("en-US", { + month: "2-digit", + day: "2-digit", + year: "numeric", + }); + const time = d.toLocaleTimeString("en-US", { + hour: "numeric", + minute: "2-digit", + }); + return `${date} @ ${time}`; } function statusFromHeartbeat(tsSec, offlineAfter = 15) { @@ -118,7 +124,7 @@ export default function DeviceList({ onSelectDevice }) { Devices - Devices connected to Borealis via Agent and their recent heartbeats. + Devices connected to Borealis via Agent and their last check-ins. @@ -148,7 +154,7 @@ export default function DeviceList({ onSelectDevice }) { direction={orderBy === "lastSeen" ? order : "asc"} onClick={() => handleSort("lastSeen")} > - Last Heartbeat + Last Seen @@ -194,7 +200,7 @@ export default function DeviceList({ onSelectDevice }) { > {r.hostname} - {timeSince(r.lastSeen)} + {formatLastSeen(r.lastSeen)}{r.os}