fix: equipment name refresh, hostname sync from agent hello
- WorkstationCard: useEffect to sync name state when ws.name prop changes - agent-ws: update hostname column on hello message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -144,9 +144,10 @@ export const setupAgentWsRoute: FastifyPluginAsync = async (fastify) => {
|
||||
}
|
||||
if (msg.type === 'hello') {
|
||||
console.log(`[agent-ws] Hello from ${msg.agent_id} (${wsId})`)
|
||||
if (msg.version) {
|
||||
db.query('UPDATE workstations SET agent_version = $1 WHERE id = $2', [msg.version, wsId]).catch(() => {})
|
||||
}
|
||||
db.query(
|
||||
'UPDATE workstations SET agent_version = $1, hostname = COALESCE($2, hostname) WHERE id = $3',
|
||||
[msg.version ?? null, msg.hostname ?? null, wsId],
|
||||
).catch(() => {})
|
||||
}
|
||||
} catch {}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user