feat: Equipment page — KKT hides connection, Windows printer, COM retry; agent update banner
- EquipmentPage: KKT hides USB/COM/Network buttons (DTO handles connection) - EquipmentPage: Printer adds Windows connection type — lists installed printers from agent - EquipmentPage: COM port section has retry button (↺) - api.ts: add listPrinters, extend connection type - workstations.ts: add /printers endpoint (list_printers command) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -262,6 +262,18 @@ const workstationRoutes: FastifyPluginAsync = async (fastify) => {
|
||||
},
|
||||
)
|
||||
|
||||
// ── GET /api/hotels/:slug/workstations/:id/printers ─────────────────────────
|
||||
fastify.get<WsParam>('/api/hotels/:slug/workstations/:id/printers', { onRequest: [fastify.authenticate] }, async (req, reply) => {
|
||||
const { id } = req.params
|
||||
try {
|
||||
const result = await sendCommandAndWait(id, { type: 'list_printers' }, 8000) as { ok: boolean; printers?: { name: string; isDefault: boolean }[]; error?: string }
|
||||
if (!result.ok) return reply.code(502).send({ error: result.error ?? 'Агент недоступен' })
|
||||
return { printers: result.printers ?? [] }
|
||||
} catch (err) {
|
||||
return reply.code(502).send({ error: err instanceof Error ? err.message : 'Ошибка' })
|
||||
}
|
||||
})
|
||||
|
||||
// ── GET /api/hotels/:slug/workstations/:id/ports ────────────────────────────
|
||||
fastify.get<WsParam>(
|
||||
'/api/hotels/:slug/workstations/:id/ports',
|
||||
|
||||
Reference in New Issue
Block a user