Compare commits

..

5 Commits

Author SHA1 Message Date
6d1cd478be merge: 合并远程更新,保留配置管理功能 2026-06-01 12:13:23 +08:00
0085c70266 feat: 统一配置文件管理 + Cron任务同步优化
- 新增配置导出/导入功能,支持一键下载和上传配置文件
- 配置文件包含:项目配置、外部服务、预警阈值、网页设置(对外IP、刷新间隔)
- 预警阈值和网页设置保存到服务器端,不再使用localStorage
- Cron任务同步改为清空旧任务,只同步当前账号实际存在的任务
- 新增API: /api/config/export, /api/config/import
- 新增API: /api/web-settings, /api/alerts (增强版)
- 优化前端:自动加载和保存网页设置
2026-06-01 12:12:35 +08:00
ccc84e4d36 fix: 修正 JavaScript 字符串转义问题(使用双反斜杠)
问题分析:
- Flask render_template_string 会解析字符串中的转义序列
- Python 字符串 '\n' 在渲染后变成真实的换行符
- 导致 JavaScript 语法错误

修复方案:
- 使用双反斜杠 '\\n'
- 渲染后得到正确的 JavaScript 字符串 '\n'
- 避免换行符直接出现在 JavaScript 代码中
2026-06-01 11:47:01 +08:00
1fdb00a1ec fix: 修复 JavaScript 字符串转义错误
修复内容:
- 修正 sendDesktopNotification 函数中的字符串转义
- warnings.join('\n') 改为 warnings.join('\n')
- 解决浏览器控制台 SyntaxError 错误
2026-06-01 11:41:19 +08:00
248c951a96 fix: 将对外 IP 固定为 121.40.164.32
修改内容:
- 移除 IP 输入框,改为静态显示
- 固定 externalIp 为 121.40.164.32
- 移除 saveExternalIp() 函数
- 所有 localhost 链接将自动替换为对外 IP
2026-06-01 11:37:07 +08:00
5 changed files with 30621 additions and 757 deletions

12
alert_config.json Normal file
View File

@@ -0,0 +1,12 @@
{
"thresholds": {
"cpu": 75,
"memory": 80,
"disk": 85,
"interval": 60
},
"web_settings": {
"external_ip": "121.40.164.32",
"refresh_interval": 30
}
}

1046
app.py

File diff suppressed because it is too large Load Diff

Binary file not shown.

30314
logs/app.log

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
==================================================
[2026-06-01T11:59:52.266560] start
Command: mkdir -p logs && nohup /home/hz1/miniconda3/envs/openclaw/bin/python3.12 app.py > logs/app.log 2>&1 & disown
Directory: /home/openclaw/.openclaw/workspace-hz4th_coder/works/pdf-translate-web
/bin/sh: 1: disown: not found