fix: 修复所有页面 loading 动画未正确移除的问题

- chat-debug.js: loadDebugInfo 完成后正确调用 renderDebugInfo 移除 loading
- agents.js: loadAgents 失败时显示错误信息替代 loading
- dashboard.js: renderLogs 无日志时显示提示信息
- memory.js: loadFiles 失败时显示错误信息
- services.js: loadServices/loadRegistry/loadBackups 添加 loading 状态并在完成/失败时移除
- extensions.js: loadCftunnel/loadClawapp 添加 loading 状态并在完成/失败时移除
- models.js: loadConfig 添加 loading 状态并在失败时显示错误
- gateway.js: loadConfig 添加 loading 状态并在失败时显示错误
- logs.js: loadLog/searchLog 使用 loading-text 样式并在失败时显示错误

确保所有异步加载函数都:
1. 开始时显示 loading 状态
2. 成功时渲染数据(自动移除 loading)
3. 失败时显示错误信息(替代 loading)
This commit is contained in:
晴天
2026-03-03 01:46:19 +08:00
parent 53f46d8ef2
commit 05771ffa63
23 changed files with 1014 additions and 124 deletions

View File

@@ -45,13 +45,8 @@ async function loadRoute() {
_currentCleanup = null
}
// 退出动画:如果有旧页面,播放退出动画后再替换
const oldPage = _contentEl.querySelector('.page, .page-loader, .chat-page')
if (oldPage) {
oldPage.classList.add('page-exit')
await new Promise(r => setTimeout(r, 100))
if (thisLoad !== _loadId) return
}
// 立即移除旧页面(不等退出动画,消除切换卡顿)
_contentEl.innerHTML = ''
// 已缓存的模块:跳过 spinner直接渲染
let mod = _moduleCache[hash]