refactor: 简化仪表盘布局
- 删除快捷链接侧边栏 - 删除快捷操作区域 - 删除服务状态区域 - 导航链接移到顶部导航栏 - 保留核心状态监控卡片
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 = `
|
||||
<span class="icon">${icons[service.name] || '🔌'}</span>
|
||||
<div class="info">
|
||||
<div class="name">${service.name}</div>
|
||||
<div class="port">端口: ${service.port}</div>
|
||||
</div>
|
||||
<span class="status-badge ${service.status}">${
|
||||
service.status === 'running' ? '运行中' :
|
||||
service.status === 'stopped' ? '已停止' : '未知'
|
||||
}</span>
|
||||
`;
|
||||
container.appendChild(card);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取服务状态失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新状态
|
||||
function refreshStatus() {
|
||||
fetchStatus();
|
||||
fetchServices();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
fetchStatus();
|
||||
fetchServices();
|
||||
|
||||
// 每 30 秒自动刷新
|
||||
setInterval(fetchStatus, 30000);
|
||||
|
||||
@@ -4,19 +4,25 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Mission Control - {{ username }}</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/dashboard.css') }}?v=20260312a">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/dashboard.css') }}?v=20260312b">
|
||||
</head>
|
||||
<body>
|
||||
<!-- 顶部导航栏 -->
|
||||
<nav class="top-nav">
|
||||
<div class="nav-brand">
|
||||
<span class="logo">🚀</span>
|
||||
<span class="title">OpenClaw Mission Control</span>
|
||||
<span class="title">Mission Control</span>
|
||||
</div>
|
||||
<div class="quick-nav">
|
||||
<a href="http://1.14.58.157:6806" target="_blank" class="nav-btn" title="思源笔记">📝 思源</a>
|
||||
<a href="http://1.14.58.157:3000" target="_blank" class="nav-btn" title="Gitea">📦 Gitea</a>
|
||||
<a href="http://1.14.58.157:8080" target="_blank" class="nav-btn" title="NocoDB">📊 NocoDB</a>
|
||||
<a href="http://1.14.58.157:18798" target="_blank" class="nav-btn" title="记忆面板">🧠 记忆</a>
|
||||
<button class="theme-toggle" aria-label="切换主题">🌙</button>
|
||||
</div>
|
||||
<div class="nav-user">
|
||||
<span class="username">{{ username }}</span>
|
||||
<a href="{{ url_for('logout') }}" class="btn-logout">退出</a>
|
||||
<button class="theme-toggle" aria-label="切换主题">🌙</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -48,23 +54,6 @@
|
||||
<span class="text">系统设置</span>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<!-- 快捷链接 -->
|
||||
<div class="quick-links">
|
||||
<div class="section-title">快捷链接</div>
|
||||
<a href="http://1.14.58.157:6806" target="_blank" class="link-item">
|
||||
<span class="icon">📝</span> 思源笔记
|
||||
</a>
|
||||
<a href="http://1.14.58.157:3000" target="_blank" class="link-item">
|
||||
<span class="icon">📦</span> Gitea
|
||||
</a>
|
||||
<a href="http://1.14.58.157:8080" target="_blank" class="link-item">
|
||||
<span class="icon">📊</span> NocoDB
|
||||
</a>
|
||||
<a href="http://1.14.58.157:18798" target="_blank" class="link-item">
|
||||
<span class="icon">🧠</span> 记忆面板
|
||||
</a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
@@ -116,37 +105,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 服务状态 -->
|
||||
<div class="section">
|
||||
<h2 class="section-title">🔌 服务状态</h2>
|
||||
<div class="services-grid" id="services-grid">
|
||||
<div class="loading">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 快捷操作 -->
|
||||
<div class="section">
|
||||
<h2 class="section-title">⚡ 快捷操作</h2>
|
||||
<div class="actions-grid">
|
||||
<button class="action-btn" onclick="location.href='http://1.14.58.157:6806'">
|
||||
<span class="icon">📝</span>
|
||||
<span>打开思源笔记</span>
|
||||
</button>
|
||||
<button class="action-btn" onclick="location.href='http://1.14.58.157:3000'">
|
||||
<span class="icon">📦</span>
|
||||
<span>打开 Gitea</span>
|
||||
</button>
|
||||
<button class="action-btn" onclick="location.href='http://1.14.58.157:18798'">
|
||||
<span class="icon">🧠</span>
|
||||
<span>记忆面板</span>
|
||||
</button>
|
||||
<button class="action-btn" onclick="refreshStatus()">
|
||||
<span class="icon">🔄</span>
|
||||
<span>刷新状态</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 其他页面占位 -->
|
||||
|
||||
Reference in New Issue
Block a user