Files
Nexus/docs/design/plans/2026-06-13-offline-alert-telegram-split.md
2026-07-08 22:31:31 +08:00

28 lines
902 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 子机离线告警独立 Telegram — 实施说明
## 涉及文件
- `server/config.py` — 新 settings 属性与 DB_OVERRIDE_MAP
- `server/infrastructure/telegram/__init__.py` — 路由与 `send_telegram` 参数化
- `server/api/settings.py` — MUTABLE_KEYS、离线 test/chats/reveal
- `frontend/src/pages/SettingsPage.vue` — 离线专用 Bot UI
- `frontend/src/types/api.ts` — 离线开关文案
- `frontend/src/utils/auditLabels.ts`
- `tests/test_telegram_offline_channel.py`
## 步骤
1. 后端配置与发送路由
2. 设置 API 与白名单
3. 前端设置页「子机离线专用 Bot」区块
4. pytest + local_verify
## 回滚
清空 `telegram_offline_*` 设置或删除 DB 行;离线告警自动回退默认 Bot。
## 测试要点
- `resolve_offline_telegram_credentials` 优先离线、回退主 Bot
- `send_telegram_offline_alert` 传入正确 token/chatmock httpx