From 77c8e93a8db57616d0c66b13eeb5f2eafa0e1998 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 23 Jun 2023 16:33:30 -0400 Subject: [PATCH] Fix terminal actions on shared websocket The full complement of functionality was not interpreted in shared context --- confluent_server/confluent/httpapi.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index ecb1d23b..3209035d 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -487,6 +487,8 @@ def wsock_handler(ws): elif clientmsg[0] == '!': msg = json.loads(clientmsg[1:]) action = msg.get('operation', None) + if not action: + action = msg.get('start', None) targ = msg.get('target', None) if targ: authdata = auth.authorize(name, targ, operation=action) @@ -524,6 +526,13 @@ def wsock_handler(ws): datacallback=datacallback, width=width, height=height) myconsoles[clientsessid] = consession + elif action == 'resize': + clientsessid = '{0}'.format(msg['sessid']) + myconsoles[clientsessid].resize( + width=msg['width'], height=msg['height']) + if action == 'break': + clientsessid = '{0}'.format(msg['sessid']) + myconsoles[clientsessid].send_break() elif action == 'stop': sessid = '{0}'.format(msg.get('sessid', None)) if sessid in myconsoles: