mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-09-11 06:48:43 -06:00
Fixed Device "Last Seen" Logic and Watchdog Behavior
This commit is contained in:
@@ -34,10 +34,10 @@ export default function DeviceDetails({ device, onBack }) {
|
||||
const tsSec = device?.lastSeen;
|
||||
if (!tsSec) return "Offline";
|
||||
const now = Date.now() / 1000;
|
||||
return now - tsSec <= 15 ? "Online" : "Offline";
|
||||
return now - tsSec <= 120 ? "Online" : "Offline";
|
||||
});
|
||||
|
||||
const statusFromHeartbeat = (tsSec, offlineAfter = 15) => {
|
||||
const statusFromHeartbeat = (tsSec, offlineAfter = 120) => {
|
||||
if (!tsSec) return "Offline";
|
||||
const now = Date.now() / 1000;
|
||||
return now - tsSec <= offlineAfter ? "Online" : "Offline";
|
||||
@@ -45,7 +45,7 @@ export default function DeviceDetails({ device, onBack }) {
|
||||
|
||||
const statusColor = (s) => (s === "Online" ? "#00d18c" : "#ff4f4f");
|
||||
|
||||
const formatLastSeen = (tsSec, offlineAfter = 15) => {
|
||||
const formatLastSeen = (tsSec, offlineAfter = 120) => {
|
||||
if (!tsSec) return "unknown";
|
||||
const now = Date.now() / 1000;
|
||||
if (now - tsSec <= offlineAfter) return "Currently Online";
|
||||
|
Reference in New Issue
Block a user