async def handler(self, websocket, path): """Handle WebSocket connections""" self.clients.add(websocket) try: async for message in websocket: data = json.loads(message) if data['command'] == 'set_target': axis = data['axis'] target = data['target'] self.verifier.set_target(axis, target) elif data['command'] == 'get_status': status = self.verifier.get_status() await websocket.send(json.dumps(status)) finally: self.clients.remove(websocket)
const getStatusColor = (status) => switch(status) case 'verified': return '#4CAF50'; case 'moving': return '#FFC107'; case 'mismatch': return '#F44336'; case 'error': return '#9E9E9E'; default: return '#2196F3'; live view axis verified