fix: 修复测试消息重复显示和详细日志输出

- 删除重复的测试消息通信模块
- 添加 openclaw-log 事件将详细日志发送到界面
- 界面监听并显示 OpenClaw 详细日志
- 日志包含:连接状态、发送请求、接收消息、响应状态、错误诊断

现在连接 OpenClaw 时会看到详细日志:
[OpenClaw] ========== 开始连接 ==========
[OpenClaw]  WebSocket 连接已建立 | 就绪状态:1
[OpenClaw] 📤 发送 connect 请求...
[OpenClaw] 📥 收到消息 (长度:123 字节)
[OpenClaw] 响应: 成功 /  失败
This commit is contained in:
2026-03-10 02:16:26 +08:00
parent f2da800bfa
commit 2552c82b97
36 changed files with 6192 additions and 26 deletions

View File

@@ -80,6 +80,13 @@ function App() {
// 更新连接状态
setTimeout(updateConnectionStatus, 100);
});
// 监听 OpenClaw 详细日志
window.electronAPI.onOpenClawLog((log) => {
const { type, message } = log;
const logType = type === 'error' ? 'error' : type === 'success' ? 'success' : type === 'warning' ? 'warning' : 'info';
addLog(logType, message);
});
};
const updateConnectionStatus = async () => {