From 3b4bebba6c99674b68d1fd4bce9185af600619f1 Mon Sep 17 00:00:00 2001 From: CakeCN Date: Tue, 9 Dec 2025 16:38:18 +0800 Subject: [PATCH] aseclient fix --- Html/apps/extension_ase/ase_client/client.py | 4 +++- Html/apps/services/asectrl_service.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Html/apps/extension_ase/ase_client/client.py b/Html/apps/extension_ase/ase_client/client.py index 66bef43..0fb1a3c 100644 --- a/Html/apps/extension_ase/ase_client/client.py +++ b/Html/apps/extension_ase/ase_client/client.py @@ -46,6 +46,7 @@ class ASEngineClient: print(f"Connected to server. SID: {self.sid}") if self._on_connect_callback is not None: self._on_connect_callback( + self, entry=self._on_connect_callback_entry, init_data=self._on_connect_callback_initData ) @@ -139,7 +140,7 @@ class ASEngineClient: cb = route_info['callback'] # 已经绑定过 entry init = route_info.get('init_data') try: - cb(data=data, init_data=init) # 传递关键字参数 + cb(self, entry=entry, data=data, init_data=init) # 传递关键字参数 except Exception as e: print(f"Callback error on route '{_route}': {e}") @@ -177,6 +178,7 @@ class ASEngineClient: if 'callback' in self.routes[route]: try: self.routes[route]['callback']( + self, entry=None, data=data, init_data=init_data diff --git a/Html/apps/services/asectrl_service.py b/Html/apps/services/asectrl_service.py index caf9078..057755e 100644 --- a/Html/apps/services/asectrl_service.py +++ b/Html/apps/services/asectrl_service.py @@ -2,11 +2,11 @@ import requests from flask_socketio import Namespace -def on_connect_to_ase(client_entry, entry, init_data, **kwargs): +def on_connect_to_ase(client, entry, init_data, **kwargs): ''' 此时刚刚建立好aseclient连接,并向前端发送打开code-server-like指令。 ''' - print(f"on_connect_to_ase {client_entry}, {namespace_entry}, {init_data}") + print(f"on_connect_to_ase{namespace_entry}, {init_data}") namespace_entry, ase_client = entry namespace_entry.emit('open-iframe',"", room=init_data['room'], namespace='/agent') namespace_entry.emit('message', "Agents服务已连接, 加载教案中", room=init_data['room'], namespace='/agent')