diff --git a/static/admin/monitor.js b/static/admin/monitor.js index 217c513..7ffe374 100644 --- a/static/admin/monitor.js +++ b/static/admin/monitor.js @@ -287,14 +287,25 @@ function showTab(name){ if(_logTimer){clearInterval(_logTimer);_logTimer=null;} // 按需加载数据 if(name==='monitor'){loadMonitor();_monitorTimer=setInterval(loadMonitor,5000);} - if(name==='tasks'){loadTasks();loadCustomActions();} - if(name==='apps')loadApks(); - if(name==='maintenance'){loadAdbDevices();loadTailscaleDevices();} + if(name==='tasks'){showSubTab('tasks',_activeSubs.tasks);loadTasks();loadCustomActions();} + if(name==='apps'){showSubTab('apps',_activeSubs.apps);loadApks();} + if(name==='maintenance'){showSubTab('maintenance',_activeSubs.maintenance);loadAdbDevices();loadTailscaleDevices();} if(name==='groups')loadGroups(); if(name==='logs'){loadLogs();if(document.getElementById('log-auto').checked)_logTimer=setInterval(loadLogs,3000);} if(name==='users')loadUsers(); } +// ================== 页内子分栏(任务/应用/维护 通用) ================== +// 每个带子分栏的 Tab 记住上次选中的子分栏,切走再切回来保持原位 +let _activeSubs = {tasks: 'plan', apps: 'apks', maintenance: 'stf'}; + +function showSubTab(tabId, name){ + _activeSubs[tabId] = name; + const tab = document.getElementById('tab-'+tabId); + tab.querySelectorAll('.sub-tab').forEach(b=>b.classList.toggle('active', b.dataset.sub===name)); + tab.querySelectorAll('.sub-panel').forEach(p=>p.classList.toggle('active', p.id===tabId+'-sub-'+name)); +} + // ================== 通用列表:搜索 + 分页 ================== // 用法: // setListPager(key,{data:()=>array, filter:(item,kw)=>bool, render:(item)=>html, diff --git a/templates/admin/monitor.html b/templates/admin/monitor.html index 253620d..cdcccde 100644 --- a/templates/admin/monitor.html +++ b/templates/admin/monitor.html @@ -63,6 +63,15 @@ body{background:var(--bg);font-family:-apple-system,"Segoe UI",Roboto,"PingFang /* 区块标题 */ .section-title{font-size:15px;font-weight:600;color:var(--text);margin:0 0 12px;padding-bottom:8px;border-bottom:2px solid var(--primary);display:inline-block} +/* 页内子分栏(维护页用) */ +.sub-tabs{display:flex;gap:4px;margin-bottom:16px;border-bottom:2px solid var(--border)} +.sub-tab{padding:9px 16px;font-size:13px;font-weight:600;color:var(--text-muted);background:none;border:none;cursor:pointer;border-radius:8px 8px 0 0;transition:all .15s;position:relative} +.sub-tab:hover{color:var(--text);background:#f1f5f9} +.sub-tab.active{color:var(--primary);background:#eff6ff} +.sub-tab.active::after{content:"";position:absolute;left:10px;right:10px;bottom:-2px;height:2px;background:var(--primary);border-radius:1px} +.sub-panel{display:none} +.sub-panel.active{display:block} + /* 表格 */ .table{background:var(--card);border-radius:12px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.06);border:1px solid var(--border);width:100%;border-collapse:collapse;margin-bottom:24px} .table thead th{background:#f1f5f9;border-bottom:2px solid var(--border);font-weight:600;color:var(--text-muted);font-size:12px;letter-spacing:.3px;padding:12px 14px;text-align:left} @@ -334,30 +343,38 @@ select.form-control{cursor:pointer}
| ID | 任务名 | 类型 | 启用 | 目标 | 调度 | 下次运行 | 重试 | 操作 | -
|---|
| ID | 任务名 | 类型 | 启用 | 目标 | 调度 | 下次运行 | 重试 | 操作 | +
|---|
| 图标 | 动作名 | 步骤数 | 创建时间 | 操作 |
|---|
| 应用名 | 包名 | 版本 | 大小 | 上传时间 | 操作 | -
|---|
| 应用名 | 包名 | 版本 | 大小 | 上传时间 | 操作 | +
|---|