mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-06-12 03:00:50 +08:00
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user