Bump version to 1.0.10

Smart WoL: TCP pre-check before sending magic packet (3s timeout).
Machine status updates via SSE: online/offline tracked in DB and
broadcast to all connected browser tabs in real-time.
- Pre-check: if machine already reachable, skip WoL and mark online
- WoL path: send 3 magic packets, wait for SSH, mark online/offline
- Backend: setMachineStatus() helper + machine_status SSE event
- Frontend: subscribeMachineStatus() SSE helper for Machines + Dashboard
- IsReachable() helper in wol package for TCP reachability checks
This commit is contained in:
2026-07-08 19:56:08 -04:00
parent ad3e879c42
commit a77f84ad34
8 changed files with 166 additions and 35 deletions
+12
View File
@@ -29,6 +29,7 @@ import { Card } from '@/components/ui/Card';
import { Pencil, Trash2, Plus, Server, Zap } from 'lucide-react';
import { toast } from 'sonner';
import { cn } from '@/lib/utils';
import { subscribeMachineStatus } from '@/lib/sse';
type MachineForm = {
id: number | undefined;
@@ -70,6 +71,17 @@ export default function Machines() {
load();
}, []);
useEffect(() => {
const unsub = subscribeMachineStatus((evt) => {
setMachines((prev) =>
prev.map((m) =>
m.id === evt.machine_id ? { ...m, status: evt.status } : m
)
);
});
return unsub;
}, []);
async function load() {
try {
const [ms, ks] = await Promise.all([