Bump version to 1.0.11

Machine status probe on page load:
- POST /api/machines/refresh probes all machines in parallel (max 20 concurrent, 1.5s timeout)
- Updates DB status and broadcasts via SSE to all connected browser tabs
- Server-side throttle: ignores refresh requests within 10s
- Machines.tsx and Dashboard.tsx fire probe on mount
- Visual "Checking machine status..." indicator in Machines table
- MachineHandler now accepts *Engine for ProbeAllMachines access
This commit is contained in:
2026-07-08 21:44:50 -04:00
parent a77f84ad34
commit 1798fc6804
8 changed files with 115 additions and 12 deletions
+1
View File
@@ -32,6 +32,7 @@ export default function Dashboard() {
})
.catch(() => {})
.finally(() => setLoading(false));
api('/api/machines/refresh', { method: 'POST' }).catch(() => {});
}, []);
useEffect(() => {
+13
View File
@@ -66,9 +66,14 @@ export default function Machines() {
const [deleteId, setDeleteId] = useState<number | null>(null);
const [form, setForm] = useState<MachineForm>(defaultForm);
const [loading, setLoading] = useState(false);
const [probing, setProbing] = useState(false);
useEffect(() => {
load();
setProbing(true);
api('/api/machines/refresh', { method: 'POST' }).catch(() => {});
const timer = setTimeout(() => setProbing(false), 5000);
return () => clearTimeout(timer);
}, []);
useEffect(() => {
@@ -212,6 +217,13 @@ export default function Machines() {
}
/>
) : (
<>
{probing && (
<div className="flex items-center gap-2 px-4 pt-3 text-xs text-muted-foreground">
<span className="inline-block h-2 w-2 bg-amber-400 rounded-full animate-pulse" />
Checking machine status...
</div>
)}
<Table>
<TableHeader>
<TableRow>
@@ -290,6 +302,7 @@ export default function Machines() {
))}
</TableBody>
</Table>
</>
)}
</div>
</Card>