feat: 添加Cron列表快捷导航按钮

This commit is contained in:
2026-04-14 10:49:08 +08:00
parent e7b5a1ce09
commit cc18d254a8

14
app.py
View File

@@ -235,7 +235,10 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
</h1>
<p class="text-gray-400 mt-1">统一管理所有项目和服务</p>
</div>
<div class="flex items-center gap-4">
<div class="flex items-center gap-3">
<button onclick="scrollToCrons()" class="btn bg-orange-600 hover:bg-orange-700 px-3 py-2 rounded-lg flex items-center gap-2">
<i class="ri-timer-line"></i> Cron 列表
</button>
<button onclick="refreshAll()" class="btn bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg flex items-center gap-2">
<i class="ri-refresh-line"></i> 刷新状态
</button>
@@ -311,7 +314,7 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
</div>
<!-- 系统 Cron 列表 -->
<div class="card rounded-xl p-6 mt-8">
<div id="cronSection" class="card rounded-xl p-6 mt-8">
<div class="flex items-center justify-between mb-4">
<h2 class="text-xl font-bold flex items-center gap-2">
<i class="ri-timer-line text-orange-400"></i>
@@ -659,6 +662,13 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
loadProjects();
}
function scrollToCrons() {
const cronSection = document.getElementById('cronSection');
if (cronSection) {
cronSection.scrollIntoView({ behavior: 'smooth' });
}
}
// 初始化
loadProjects();
loadCrons();