From 1fdb00a1ec9cf93dddfaa44f75a75e3922fa3cbd Mon Sep 17 00:00:00 2001 From: hz4th_coder Date: Mon, 1 Jun 2026 11:41:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20JavaScript=20?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E8=BD=AC=E4=B9=89=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复内容: - 修正 sendDesktopNotification 函数中的字符串转义 - warnings.join('\n') 改为 warnings.join('\n') - 解决浏览器控制台 SyntaxError 错误 --- app.py | 2 +- logs/app.log | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index 82c8518..128d2d9 100644 --- a/app.py +++ b/app.py @@ -2522,7 +2522,7 @@ HTML_TEMPLATE = ''' if (!desktopNotifyEnabled || Notification.permission !== 'granted') return; const notification = new Notification('⚠️ 系统资源告警', { - body: warnings.join('\\n'), + body: warnings.join('\n'), icon: 'data:image/svg+xml,📊', tag: 'system-alert', requireInteraction: false diff --git a/logs/app.log b/logs/app.log index 3206f85..fdcb740 100644 --- a/logs/app.log +++ b/logs/app.log @@ -1,8 +1,8 @@ -[2026-06-01 11:36:47] ================================================== -[2026-06-01 11:36:47] 项目服务管理面板 v2.0.0 启动 -[2026-06-01 11:36:47] 访问地址: http://localhost:16022 -[2026-06-01 11:36:47] 进程PID: 773965 -[2026-06-01 11:36:47] ================================================== +[2026-06-01 11:40:58] ================================================== +[2026-06-01 11:40:58] 项目服务管理面板 v2.0.0 启动 +[2026-06-01 11:40:58] 访问地址: http://localhost:16022 +[2026-06-01 11:40:58] 进程PID: 774683 +[2026-06-01 11:40:58] ================================================== * 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,5 +10,4 @@ * Running on http://127.0.0.1:16022 * Running on http://192.168.0.101:16022 Press CTRL+C to quit -127.0.0.1 - - [01/Jun/2026 11:37:01] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [01/Jun/2026 11:37:01] "GET /api/projects HTTP/1.1" 200 - +127.0.0.1 - - [01/Jun/2026 11:41:03] "GET / HTTP/1.1" 200 -