feat: ping through agent — send ICMP ping from workstation via agent

Adds a ping tool in the Equipment page workstation card (visible when
agent is online). User enters an IP/hostname, the request goes through
the PMS backend → WebSocket → agent → executes ping -n 4, returns
raw output displayed in a monospace block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-29 10:08:38 +03:00
parent 7f546d809e
commit 11300bccbf
3 changed files with 74 additions and 0 deletions

View File

@@ -361,6 +361,8 @@ export const api = {
req<{ ports: { port: string; description?: string }[] }>('GET', `/api/hotels/${slug}/workstations/${wsId}/ports`),
listPrinters: (slug: string, wsId: string) =>
req<{ printers: { name: string; isDefault: boolean }[] }>('GET', `/api/hotels/${slug}/workstations/${wsId}/printers`),
ping: (slug: string, wsId: string, host: string) =>
req<{ ok: boolean; output?: string; error?: string }>('POST', `/api/hotels/${slug}/workstations/${wsId}/ping`, { host }),
},
// ── Agents ────────────────────────────────────────────────────────────────