fix: JavaScript换行符转义问题

This commit is contained in:
2026-04-23 18:31:07 +08:00
parent 6e5b963b3f
commit 38db7b0606
2 changed files with 64 additions and 345 deletions

2
app.py
View File

@@ -1764,7 +1764,7 @@ HTML_TEMPLATE = '''<!DOCTYPE html>
if (!desktopNotifyEnabled || Notification.permission !== 'granted') return;
const notification = new Notification('⚠️ 系统资源告警', {
body: warnings.join('\n'),
body: warnings.join('\\n'),
icon: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">📊</text></svg>',
tag: 'system-alert',
requireInteraction: false