myagent-ai 1.23.22 → 1.23.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.23.22",
3
+ "version": "1.23.23",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
@@ -192,24 +192,28 @@ window.addEventListener('popstate',function(e){
192
192
  let _deptTreeNeedsRefresh=false;
193
193
  function closeModal(){$('modalContainer').innerHTML='';if(_deptTreeNeedsRefresh){_deptTreeNeedsRefresh=false;renderDepartments()}}
194
194
 
195
- // Init
195
+ // Init — [v1.23.22] 使用 DOMContentLoaded 推迟到所有 admin 脚本加载后再执行
196
+ // 原因:此文件最先加载,此时 window._adminRenderers 尚未注册任何渲染器,
197
+ // showPage() 检查 renderers[page] 为空会静默跳过,导致内容区空白。
196
198
  (function(){
197
- var hash=window.location.hash.slice(1)||'';
198
- var page=hash?hash.split('~')[0]:'';
199
- var sub=hash?hash.slice(page.length+1):'';
200
- // 兼容旧 URL query param ?page=xxx
201
- if(!page){
202
- var params=new URLSearchParams(window.location.search);
203
- page=params.get('page')||'dashboard';
204
- }
205
- if(sub)_navSubState=sub;
206
- if(pages[page]){
207
- history.replaceState({page:page,sub:sub||null},'','#'+page+(sub?'~'+sub:''));
208
- showPage(page,false);
209
- }else{
210
- history.replaceState({page:'dashboard',sub:null},'','#dashboard');
211
- showPage('dashboard',false);
212
- }
199
+ window.addEventListener('DOMContentLoaded', function() {
200
+ var hash=window.location.hash.slice(1)||'';
201
+ var page=hash?hash.split('~')[0]:'';
202
+ var sub=hash?hash.slice(page.length+1):'';
203
+ // 兼容旧 URL query param ?page=xxx
204
+ if(!page){
205
+ var params=new URLSearchParams(window.location.search);
206
+ page=params.get('page')||'dashboard';
207
+ }
208
+ if(sub)_navSubState=sub;
209
+ if(pages[page]){
210
+ history.replaceState({page:page,sub:sub||null},'','#'+page+(sub?'~'+sub:''));
211
+ showPage(page,false);
212
+ }else{
213
+ history.replaceState({page:'dashboard',sub:null},'','#dashboard');
214
+ showPage('dashboard',false);
215
+ }
216
+ });
213
217
  })();
214
218
  setInterval(()=>{api('/api/status').catch(()=>{})},30000);
215
219