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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user