feat: TTLock integration + fix agent offline status
- Add TTLock electronic lock module: settings page, room-lock mapping, card issuance via agent command (ttlock:write_card) - Fix agent offline: EquipmentPage now polls every 30s + reacts to workstation:online/offline WebSocket events instantly - Backend broadcasts workstation online/offline events to hotel clients via existing WebSocket (agent-ws.ts) - New DB migration 048_ttlock.sql: hotel_ttlock_config, room_lock_mappings, card_issuances tables - New backend routes: GET/PATCH ttlock/config, POST ttlock/token, GET ttlock/locks, POST/DELETE ttlock/room-locks, POST issue-card - "Выдать ключ (TTLock)" button in BookingDetailPanel for confirmed/checked_in - TTLock page added to sidebar under Настройки Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,7 @@ import chatRoutes from './routes/chat'
|
||||
import workstationRoutes from './routes/workstations'
|
||||
import agentReleaseRoutes from './routes/agent-release'
|
||||
import wifiSettingsRoutes, { wifiAuthVerify } from './routes/wifi-settings'
|
||||
import ttlockRoutes from './routes/ttlock'
|
||||
import { setupAgentWsRoute } from './agent-ws'
|
||||
import { startJobs } from './jobs'
|
||||
|
||||
@@ -126,6 +127,7 @@ export async function buildApp() {
|
||||
await fastify.register(agentReleaseRoutes)
|
||||
await fastify.register(wifiSettingsRoutes)
|
||||
await fastify.register(wifiAuthVerify)
|
||||
await fastify.register(ttlockRoutes)
|
||||
await fastify.register(setupAgentWsRoute)
|
||||
|
||||
startJobs()
|
||||
|
||||
Reference in New Issue
Block a user