mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-31 05:10:14 +08:00
fix: 修复多项关键 Bug,与 openclaw 上游协议对齐
- main.js: wsClient.connect 传参格式错误(完整 ws:// URL → host:port) - ws-client.js: request() 等待重连时不处理 onReady 握手失败 - gateway.js: bind 写入非法值 'all',改为 openclaw 合法值 'lan' - device.rs: connect payload 从 v2 升级到 v3,补充 platform/deviceFamily - config.rs: macOS reload_gateway 在 async fn 中用同步 Command 阻塞 tokio - service.rs: Windows check_service_status 端口硬编码 18789,改为读配置 - extensions.rs: parse_cftunnel_status 全角冒号解析失败,添加 split_after_colon - tauri-api.js: cachedInvoke miss 时 logRequest 被记录两次 - tauri-api.js: mock 补充 list_agents / restart_gateway - chat.js: 附件对象冗余 data 字段(双倍内存)+ 缩进修复 - services.js: 服务操作缺少操作中 toast 反馈
This commit is contained in:
@@ -36,7 +36,7 @@ export async function render() {
|
||||
<div style="padding:0 var(--space-sm) var(--space-sm)">
|
||||
<button class="btn btn-sm btn-secondary" id="btn-export-zip" style="width:100%">打包下载全部</button>
|
||||
</div>
|
||||
<div id="file-tree" class="loading-text">加载中...</div>
|
||||
<div id="file-tree"></div>
|
||||
</div>
|
||||
<div class="memory-editor">
|
||||
<div class="editor-toolbar">
|
||||
@@ -54,15 +54,18 @@ export async function render() {
|
||||
|
||||
const state = { category: 'memory', currentPath: null, agentId: 'main' }
|
||||
|
||||
// 非阻塞加载 agent 列表,然后填充下拉框
|
||||
// 先用默认选项填充下拉框,立即显示页面
|
||||
const agentSelect = page.querySelector('#agent-select')
|
||||
agentSelect.innerHTML = '<option value="main">main</option>'
|
||||
|
||||
// 异步加载 agent 列表并更新下拉框
|
||||
api.listAgents().then(agents => {
|
||||
const select = page.querySelector('#agent-select')
|
||||
if (!select) return
|
||||
if (!agentSelect) return
|
||||
const options = agents.map(a => {
|
||||
const label = a.identityName ? a.identityName.split(',')[0].trim() : a.id
|
||||
return `<option value="${a.id}">${a.id}${a.id !== label ? ' — ' + label : ''}</option>`
|
||||
}).join('')
|
||||
select.innerHTML = options
|
||||
agentSelect.innerHTML = options
|
||||
}).catch(() => {})
|
||||
|
||||
// Agent 切换
|
||||
@@ -141,7 +144,6 @@ export async function render() {
|
||||
|
||||
async function loadFiles(page, state) {
|
||||
const tree = page.querySelector('#file-tree')
|
||||
tree.innerHTML = '<div style="color:var(--text-tertiary);padding:12px">加载中...</div>'
|
||||
|
||||
try {
|
||||
const files = await api.listMemoryFiles(state.category, state.agentId)
|
||||
|
||||
Reference in New Issue
Block a user