refactor: 简化仪表盘布局

- 删除快捷链接侧边栏
- 删除快捷操作区域
- 删除服务状态区域
- 导航链接移到顶部导航栏
- 保留核心状态监控卡片
This commit is contained in:
小白
2026-03-12 20:49:41 +08:00
parent f1e4185c8f
commit a9b35727ce
3 changed files with 41 additions and 93 deletions

View File

@@ -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);