From a9b35727cef408dd9882f33a751da03d500a0354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD?= Date: Thu, 12 Mar 2026 20:49:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=AE=80=E5=8C=96=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除快捷链接侧边栏 - 删除快捷操作区域 - 删除服务状态区域 - 导航链接移到顶部导航栏 - 保留核心状态监控卡片 --- static/css/dashboard.css | 32 ++++++++++++++++++ static/js/dashboard.js | 42 ------------------------ templates/dashboard/index.html | 60 +++++----------------------------- 3 files changed, 41 insertions(+), 93 deletions(-) diff --git a/static/css/dashboard.css b/static/css/dashboard.css index 7e7e925..f12a18f 100644 --- a/static/css/dashboard.css +++ b/static/css/dashboard.css @@ -76,6 +76,38 @@ body { color: var(--text-primary); } +/* 快捷导航栏 */ +.quick-nav { + display: flex; + align-items: center; + gap: 8px; +} + +.nav-btn { + display: flex; + align-items: center; + gap: 6px; + padding: 8px 14px; + background: rgba(255, 255, 255, 0.9); + border: none; + border-radius: 20px; + font-size: 14px; + font-weight: 500; + color: #333; + text-decoration: none; + transition: all 0.3s ease; +} + +[data-theme="dark"] .nav-btn { + background: rgba(45, 55, 72, 0.9); + color: #e2e8f0; +} + +.nav-btn:hover { + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} + .nav-user { display: flex; align-items: center; diff --git a/static/js/dashboard.js b/static/js/dashboard.js index abacd71..5e48125 100644 --- a/static/js/dashboard.js +++ b/static/js/dashboard.js @@ -50,56 +50,14 @@ async function fetchStatus() { } } -// 获取服务状态 -async function fetchServices() { - try { - const response = await fetch('/api/status/services'); - const result = await response.json(); - - if (result.success) { - const container = document.getElementById('services-grid'); - container.innerHTML = ''; - - const icons = { - 'Flask': '🌐', - '思源笔记': '📝', - 'Gitea': '📦', - 'NocoDB': '📊', - 'Memory Viewer': '🧠' - }; - - result.data.forEach(service => { - const card = document.createElement('div'); - card.className = 'service-card'; - card.innerHTML = ` - ${icons[service.name] || '🔌'} -
-
${service.name}
-
端口: ${service.port}
-
- ${ - service.status === 'running' ? '运行中' : - service.status === 'stopped' ? '已停止' : '未知' - } - `; - container.appendChild(card); - }); - } - } catch (error) { - console.error('获取服务状态失败:', error); - } -} - // 刷新状态 function refreshStatus() { fetchStatus(); - fetchServices(); } // 初始化 document.addEventListener('DOMContentLoaded', () => { fetchStatus(); - fetchServices(); // 每 30 秒自动刷新 setInterval(fetchStatus, 30000); diff --git a/templates/dashboard/index.html b/templates/dashboard/index.html index f20dae6..c170de8 100644 --- a/templates/dashboard/index.html +++ b/templates/dashboard/index.html @@ -4,19 +4,25 @@ Mission Control - {{ username }} - + @@ -48,23 +54,6 @@ 系统设置 - - - @@ -116,37 +105,6 @@ - - -
-

🔌 服务状态

-
-
加载中...
-
-
- - -
-

⚡ 快捷操作

-
- - - - -
-