feat: 前端整体改版(仪表控制台主题:自托管 Bricolage Grotesque+IBM Plex Mono 字体、暖纸底+墨色+深青主色、卡片/表格/徽章/模态框/Toast 全面细化、Tab 切换动画)+ fix: showTab 硬编码 tab 列表移除维护后索引错位、tools 分支调用已删的 loadStfDevMgmt、导航移除失效维护Tab

This commit is contained in:
2026-08-19 14:03:02 +08:00
parent 2d1b10c7f3
commit 83ba489f57
8 changed files with 211 additions and 183 deletions
+5 -3
View File
@@ -87,15 +87,17 @@ function showTab(name){
_activeTab=name;
document.querySelectorAll('.tab-panel').forEach(p=>p.classList.remove('active'));
document.querySelectorAll('.navbar .tab').forEach(t=>t.classList.remove('active'));
document.getElementById('tab-'+name).classList.add('active');
document.querySelectorAll('.navbar .tab')[['monitor','tasks','groups','logs','users','maintenance','tools'].indexOf(name)].classList.add('active');
const panel=document.getElementById('tab-'+name);
if(panel)panel.classList.add('active');
const btn=document.querySelector('.navbar .tab[data-tab="'+name+'"]');
if(btn)btn.classList.add('active');
// 停止所有定时器
if(_monitorTimer){clearInterval(_monitorTimer);_monitorTimer=null;}
if(_logTimer){clearInterval(_logTimer);_logTimer=null;}
// 按需加载数据
if(name==='monitor'){loadMonitor();_monitorTimer=setInterval(loadMonitor,5000);}
if(name==='tasks'){showSubTab('tasks',_activeSubs.tasks);loadTasks();loadCustomActions();}
if(name==='tools'){showSubTab('tools',_activeSubs.tools);loadToolsDevices();loadAdbDevices();loadTailscaleDevices();loadApks();loadStfDevMgmt();}
if(name==='tools'){showSubTab('tools',_activeSubs.tools);loadToolsDevices();loadAdbDevices();loadTailscaleDevices();loadApks();}
if(name==='groups')loadGroups();
if(name==='logs'){loadLogs();if(document.getElementById('log-auto').checked)_logTimer=setInterval(loadLogs,3000);}
if(name==='users')loadUsers();