Increased Offline Detection Timeout from 2 minutes to 5 minutes.

This commit is contained in:
2025-09-08 21:22:00 -06:00
parent aa3650d84f
commit 64eeaa5bfb
2 changed files with 4 additions and 4 deletions

View File

@@ -61,10 +61,10 @@ export default function DeviceDetails({ device, onBack }) {
const tsSec = device?.lastSeen; const tsSec = device?.lastSeen;
if (!tsSec) return "Offline"; if (!tsSec) return "Offline";
const now = Date.now() / 1000; const now = Date.now() / 1000;
return now - tsSec <= 120 ? "Online" : "Offline"; return now - tsSec <= 300 ? "Online" : "Offline";
}); });
const statusFromHeartbeat = (tsSec, offlineAfter = 120) => { const statusFromHeartbeat = (tsSec, offlineAfter = 300) => {
if (!tsSec) return "Offline"; if (!tsSec) return "Offline";
const now = Date.now() / 1000; const now = Date.now() / 1000;
return now - tsSec <= offlineAfter ? "Online" : "Offline"; return now - tsSec <= offlineAfter ? "Online" : "Offline";

View File

@@ -28,7 +28,7 @@ import CachedIcon from "@mui/icons-material/Cached";
import { DeleteDeviceDialog, CreateCustomViewDialog, RenameCustomViewDialog } from "../Dialogs.jsx"; import { DeleteDeviceDialog, CreateCustomViewDialog, RenameCustomViewDialog } from "../Dialogs.jsx";
import QuickJob from "../Scheduling/Quick_Job.jsx"; import QuickJob from "../Scheduling/Quick_Job.jsx";
function formatLastSeen(tsSec, offlineAfter = 120) { function formatLastSeen(tsSec, offlineAfter = 300) {
if (!tsSec) return "unknown"; if (!tsSec) return "unknown";
const now = Date.now() / 1000; const now = Date.now() / 1000;
if (now - tsSec <= offlineAfter) return "Currently Online"; if (now - tsSec <= offlineAfter) return "Currently Online";
@@ -45,7 +45,7 @@ function formatLastSeen(tsSec, offlineAfter = 120) {
return `${date} @ ${time}`; return `${date} @ ${time}`;
} }
function statusFromHeartbeat(tsSec, offlineAfter = 120) { function statusFromHeartbeat(tsSec, offlineAfter = 300) {
if (!tsSec) return "Offline"; if (!tsSec) return "Offline";
const now = Date.now() / 1000; const now = Date.now() / 1000;
return now - tsSec <= offlineAfter ? "Online" : "Offline"; return now - tsSec <= offlineAfter ? "Online" : "Offline";