diff --git a/app.py b/app.py index b5d80f5..3b3b6b4 100644 --- a/app.py +++ b/app.py @@ -1040,7 +1040,7 @@ HTML_TEMPLATE = ''' - 项目服务管理面板 v2.6 + 项目服务管理面板 v2.7 @@ -1302,7 +1302,14 @@ HTML_TEMPLATE = '''
- + +
@@ -1578,7 +1585,7 @@ HTML_TEMPLATE = ''' realtimeTimer = null; document.getElementById('realtimeCheck').checked = false; document.getElementById('realtimeToggle').classList.remove('active'); - document.getElementById('realtimeIndicator').textContent = ''; + document.getElementById('realtimeIndicator').classList.add('hidden'); } if (tab === 'cron') { @@ -1593,6 +1600,15 @@ HTML_TEMPLATE = ''' let realtimeTimer = null; let realtimeInterval = 2; // 秒 + function updateRealtimeInterval() { + realtimeInterval = parseInt(document.getElementById('realtimeIntervalSelect').value) || 2; + // 如果正在监控,重新启动定时器 + if (realtimeTimer) { + clearInterval(realtimeTimer); + realtimeTimer = setInterval(loadSystemStats, realtimeInterval * 1000); + } + } + async function loadSystemStats() { try { const res = await fetch('/api/system/stats'); @@ -1649,14 +1665,14 @@ HTML_TEMPLATE = ''' if (checked) { toggle.classList.add('active'); - indicator.textContent = '每' + realtimeInterval + '秒'; + indicator.classList.remove('hidden'); // 立即加载一次 loadSystemStats(); // 启动定时器 realtimeTimer = setInterval(loadSystemStats, realtimeInterval * 1000); } else { toggle.classList.remove('active'); - indicator.textContent = ''; + indicator.classList.add('hidden'); // 停止定时器 if (realtimeTimer) { clearInterval(realtimeTimer); diff --git a/logs/app.log b/logs/app.log index 59498aa..9957e6b 100644 --- a/logs/app.log +++ b/logs/app.log @@ -1,8 +1,8 @@ -[2026-04-23 17:27:44] ================================================== -[2026-04-23 17:27:44] 项目服务管理面板 v2.0.0 启动 -[2026-04-23 17:27:44] 访问地址: http://localhost:19013 -[2026-04-23 17:27:44] 进程PID: 1130035 -[2026-04-23 17:27:44] ================================================== +[2026-04-23 17:35:41] ================================================== +[2026-04-23 17:35:41] 项目服务管理面板 v2.0.0 启动 +[2026-04-23 17:35:41] 访问地址: http://localhost:19013 +[2026-04-23 17:35:41] 进程PID: 1133475 +[2026-04-23 17:35:41] ================================================== * Serving Flask app 'app' * Debug mode: off WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. @@ -10,33 +10,8 @@ WARNING: This is a development server. Do not use it in a production deployment. * Running on http://127.0.0.1:19013 * Running on http://192.168.2.17:19013 Press CTRL+C to quit -127.0.0.1 - - [23/Apr/2026 17:27:49] "GET /api/system/stats HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:27:51] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:27:52] "GET / HTTP/1.1" 200 - -192.168.2.14 - - [23/Apr/2026 17:27:53] "GET /api/projects HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:27:54] "GET /api/projects HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:02] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:02] "GET / HTTP/1.1" 200 - -192.168.2.14 - - [23/Apr/2026 17:28:03] "GET /api/projects HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:28:04] "GET /api/projects HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:10] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:12] "GET / HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:28:12] "GET /api/projects HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:12] "GET / HTTP/1.1" 200 - -192.168.2.14 - - [23/Apr/2026 17:28:13] "GET /api/projects HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:28:14] "GET /api/projects HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:21] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:22] "GET / HTTP/1.1" 200 - -192.168.2.14 - - [23/Apr/2026 17:28:23] "GET /api/projects HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:28:24] "GET /api/projects HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:31] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:32] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:33] "GET /api/system/stats HTTP/1.1" 200 - -192.168.2.14 - - [23/Apr/2026 17:28:33] "GET /api/projects HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:28:34] "GET /api/projects HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:40] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:41] "GET / HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:28:42] "GET /api/projects HTTP/1.1" 200 - -127.0.0.1 - - [23/Apr/2026 17:28:43] "GET / HTTP/1.1" 200 - -192.168.2.14 - - [23/Apr/2026 17:28:43] "GET /api/projects HTTP/1.1" 200 - -192.168.2.8 - - [23/Apr/2026 17:28:44] "GET /api/projects HTTP/1.1" 200 - +127.0.0.1 - - [23/Apr/2026 17:35:43] "GET / HTTP/1.1" 200 - +127.0.0.1 - - [23/Apr/2026 17:35:44] "GET / HTTP/1.1" 200 - +192.168.2.8 - - [23/Apr/2026 17:35:45] "GET /api/projects HTTP/1.1" 200 - +127.0.0.1 - - [23/Apr/2026 17:35:53] "GET / HTTP/1.1" 200 - +192.168.2.8 - - [23/Apr/2026 17:35:55] "GET /api/projects HTTP/1.1" 200 -