From 69ade8dcbb8f91a4509516cd02693fbb4d9294a4 Mon Sep 17 00:00:00 2001
From: hubian <908234780@qq.com>
Date: Fri, 24 Apr 2026 00:20:20 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=9B=E7=A8=8B=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=80=E5=85=B3=EF=BC=88=E9=BB=98=E8=AE=A4?=
=?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.py | 34 +++++++++++++----
logs/app.log | 102 ++++++++++++++++++++++++++++++++++-----------------
2 files changed, 95 insertions(+), 41 deletions(-)
diff --git a/app.py b/app.py
index ca49db6..4818399 100644
--- a/app.py
+++ b/app.py
@@ -1155,7 +1155,7 @@ HTML_TEMPLATE = '''
- 项目服务管理面板 v3.3
+ 项目服务管理面板 v3.3.1
@@ -1516,6 +1516,10 @@ HTML_TEMPLATE = '''
●
+
+
+
+
@@ -1908,6 +1912,7 @@ HTML_TEMPLATE = '''
clearInterval(realtimeTimer);
realtimeTimer = null;
document.getElementById('realtimeCheck').checked = false;
+ document.getElementById('showProcessListCheck').checked = false;
document.getElementById('realtimeToggle').classList.remove('active');
document.getElementById('realtimeIndicator').classList.add('hidden');
document.getElementById('processListSection').classList.add('hidden');
@@ -2134,8 +2139,8 @@ HTML_TEMPLATE = '''
// 检查阈值
checkThresholds(data);
- // 如果实时监控开启,加载进程列表
- if (document.getElementById('realtimeCheck').checked) {
+ // 如果实时监控和进程列表都开启,加载进程列表
+ if (document.getElementById('realtimeCheck').checked && document.getElementById('showProcessListCheck').checked) {
loadTopProcesses();
}
@@ -2195,21 +2200,23 @@ HTML_TEMPLATE = '''
const checked = document.getElementById('realtimeCheck').checked;
const toggle = document.getElementById('realtimeToggle');
const indicator = document.getElementById('realtimeIndicator');
- const processSection = document.getElementById('processListSection');
if (checked) {
toggle.classList.add('active');
indicator.classList.remove('hidden');
- processSection.classList.remove('hidden');
// 立即加载一次
loadSystemStats();
- loadTopProcesses();
// 启动定时器
realtimeTimer = setInterval(loadSystemStats, realtimeInterval * 1000);
+ // 如果进程列表开关也开启,则显示并加载
+ if (document.getElementById('showProcessListCheck').checked) {
+ document.getElementById('processListSection').classList.remove('hidden');
+ loadTopProcesses();
+ }
} else {
toggle.classList.remove('active');
indicator.classList.add('hidden');
- processSection.classList.add('hidden');
+ document.getElementById('processListSection').classList.add('hidden');
// 停止定时器
if (realtimeTimer) {
clearInterval(realtimeTimer);
@@ -2217,6 +2224,19 @@ HTML_TEMPLATE = '''
}
}
}
+
+ function toggleProcessList() {
+ const checked = document.getElementById('showProcessListCheck').checked;
+ const realtimeChecked = document.getElementById('realtimeCheck').checked;
+ const processSection = document.getElementById('processListSection');
+
+ if (checked && realtimeChecked) {
+ processSection.classList.remove('hidden');
+ loadTopProcesses();
+ } else {
+ processSection.classList.add('hidden');
+ }
+ }
// IP 保存
function saveExternalIp() {
diff --git a/logs/app.log b/logs/app.log
index ea6e738..2393056 100644
--- a/logs/app.log
+++ b/logs/app.log
@@ -1,8 +1,8 @@
-[2026-04-23 23:57:38] ==================================================
-[2026-04-23 23:57:38] 项目服务管理面板 v2.0.0 启动
-[2026-04-23 23:57:38] 访问地址: http://localhost:19013
-[2026-04-23 23:57:38] 进程PID: 1274690
-[2026-04-23 23:57:38] ==================================================
+[2026-04-24 00:19:49] ==================================================
+[2026-04-24 00:19:49] 项目服务管理面板 v2.0.0 启动
+[2026-04-24 00:19:49] 访问地址: http://localhost:19013
+[2026-04-24 00:19:49] 进程PID: 1284917
+[2026-04-24 00:19:49] ==================================================
* 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,32 +10,66 @@ 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 23:57:42] "GET / HTTP/1.1" 200 -
-192.168.2.14 - - [23/Apr/2026 23:57:43] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:57:45] "GET / HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:57:47] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:57:52] "GET / HTTP/1.1" 200 -
-192.168.2.14 - - [23/Apr/2026 23:57:53] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:57:55] "GET / HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:57:57] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:02] "GET / HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:02] "GET / HTTP/1.1" 200 -
-192.168.2.14 - - [23/Apr/2026 23:58:03] "GET /api/projects HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:58:04] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:05] "GET / HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:58:07] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:12] "GET / HTTP/1.1" 200 -
-192.168.2.14 - - [23/Apr/2026 23:58:13] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:15] "GET / HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:58:17] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:19] "GET /api/system/processes?limit=5 HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:22] "GET / HTTP/1.1" 200 -
-192.168.2.14 - - [23/Apr/2026 23:58:23] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:25] "GET / HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:58:27] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:32] "GET / HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:32] "GET / HTTP/1.1" 200 -
-192.168.2.14 - - [23/Apr/2026 23:58:33] "GET /api/projects HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:58:34] "GET /api/projects HTTP/1.1" 200 -
-127.0.0.1 - - [23/Apr/2026 23:58:35] "GET / HTTP/1.1" 200 -
-192.168.2.8 - - [23/Apr/2026 23:58:37] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:49] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:49] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:49] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:50] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:50] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:50] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:50] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:50] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:50] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:50] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:51] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:51] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:51] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:51] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:51] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:52] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:52] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:52] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:52] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:53] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:53] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:53] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:53] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:53] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:54] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:54] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:54] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:55] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:55] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:55] "GET / HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:55] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:55] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:56] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:56] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:56] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:57] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:57] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:57] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:57] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:58] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:19:58] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:58] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:59] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.8 - - [24/Apr/2026 00:19:59] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:19:59] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:00] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:00] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:00] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:20:01] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:01] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:02] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:20:03] "GET / HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:20:03] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:04] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.8 - - [24/Apr/2026 00:20:04] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:04] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:06] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:20:08] "GET / HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:08] "GET /api/system/stats HTTP/1.1" 200 -
+192.168.2.8 - - [24/Apr/2026 00:20:09] "GET /api/projects HTTP/1.1" 200 -
+192.168.2.14 - - [24/Apr/2026 00:20:10] "GET /api/system/stats HTTP/1.1" 200 -
+127.0.0.1 - - [24/Apr/2026 00:20:18] "GET / HTTP/1.1" 200 -
+192.168.2.8 - - [24/Apr/2026 00:20:19] "GET /api/projects HTTP/1.1" 200 -