fix: db.get_or_404 -> query.get_or_404 + rename to Palladium Monitor

- 修复删除快照时 AttributeError: SQLAlchemy.get_or_404 (低版本兼容)
- UI/标题/邮件主题从 'Palladium Z1 Monitor' 改为 'Palladium Monitor'
This commit is contained in:
Your Name
2026-07-08 14:46:18 +08:00
parent 89dc6b4449
commit 6726524c50
17 changed files with 46 additions and 46 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
# Palladium Z1 Monitor
# Palladium Monitor
LD 逻辑板使用监控系统 — 解析 `test_server -short` 输出,可视化展示 Palladium Z1 仿真器的逻辑板状态、逻辑板利用率、作业信息和 T-Pod 可用性。
LD 逻辑板使用监控系统 — 解析 `test_server -short` 输出,可视化展示 Palladium 仿真器的逻辑板状态、逻辑板利用率、作业信息和 T-Pod 可用性。
## 功能
@@ -37,7 +37,7 @@ python3 app.py
### 方式二:API 推送 (collect.py + 一键安装)
在 Palladium Z1 主机上部署采集 agent,**推荐**用一键脚本(处理 env 加载、crontab、依赖):
在 Palladium 主机上部署采集 agent,**推荐**用一键脚本(处理 env 加载、crontab、依赖):
```bash
# 把 palladium-monitor/ 整个目录 scp 到 Z1 主机, 然后:
@@ -194,7 +194,7 @@ gunicorn --workers 2 --bind 0.0.0.0:5100 app:app
| `SMTP_USE_TLS` | ❌ | `true` | 是否用 STARTTLS (端口 587 时设为 `true`) |
| `SMTP_USE_SSL` | ❌ | `false` | 是否用隐式 SSL (端口 465 时设为 `true`) |
| `MAIL_FROM` | 启用时必填 | — | 发件人邮箱 |
| `MAIL_FROM_NAME` | ❌ | `Palladium Z1 Monitor` | 发件人显示名 |
| `MAIL_FROM_NAME` | ❌ | `Palladium Monitor` | 发件人显示名 |
| `MAIL_TO` | 启用时必填 | — | 收件人列表, 英文逗号分隔 (如 `alice@x.com,bob@y.com`) |
| `MAIL_SEND_HOUR` | ❌ | `9` | 每天发送时间-小时 (0-23) |
| `MAIL_SEND_MINUTE` | ❌ | `0` | 每天发送时间-分钟 (0-59) |
@@ -251,7 +251,7 @@ ExecStart=/usr/bin/gunicorn --workers 2 --bind 0.0.0.0:5100 app:app
#### 邮件内容示例
每日报告包含:
- **主题**: `[Palladium Z1] 每日报告 YYYY-MM-DD — 利用率 X.X%`
- **主题**: `[Palladium] 每日报告 YYYY-MM-DD — 利用率 X.X%`
- **正文 (HTML + 纯文本)**: 系统信息 / 当前指标卡片 / 近 24h 趋势统计 + 样本柱状图 / 离线板列表 / 活跃作业列表
- **多部分**: 同时发 HTML 和纯文本, 邮件客户端自动选最合适的渲染