# 2026-05-29 推送页面 Round 2 迭代功能 ## 变更摘要 1. F5: 同步模式详细说明 — 每种模式下方显示说明文字,切换时动态更新 2. F2: 服务器在线状态标识 — 服务器列表选项显示🟢/🔴在线/离线标识 3. F1: 失败自动重试 — 推送失败自动创建重试任务 + 失败行"🔄 重试"按钮 4. F3: 推送完成 Telegram 通知 — 推送完成/部分失败/全部失败发 Telegram 消息含详情 5. F4: 文件内容预览 — 文件管理器点击文件名弹出内容预览模态框 ## 动机 推送页面 Round 1 功能已上线,但存在 5 个体验/运维缺陷:同步模式含义不明、无法区分在线/离线服务器、推送失败需手动跳转重试页面、推送完成无远程通知、文件管理器无法预览文件内容确认推送正确性。 ## 涉及文件 ### 后端 - `server/application/services/sync_engine_v2.py` — 失败自动创建 PushRetryJob + Telegram 通知 - `_sync_one()`: 失败时自动创建 `PushRetryJob(status="pending", max_retries=3)` - `sync_files()`: 完成后调用 `send_telegram_sync_complete()` 发 Telegram - 返回 dict 中失败 server 增加 `retry_job_id` 字段 - `server/api/websocket.py` — `broadcast_sync_progress()` 增加 `retry_job_id` 参数 - `server/infrastructure/telegram/__init__.py` — 新增 `send_telegram_sync_complete()` 函数 - 参数: completed, failed, total, source_path, operator, failed_servers, duration_seconds - 全部成功🟢 / 部分失败🟡 / 全部失败🔴 三种消息样式 - 失败服务器列表最多显示 10 台 - `server/api/sync_v2.py` — 新增 `POST /api/sync/local-file-preview` 端点 - 安全: `os.path.realpath()` + `startswith("/tmp/nexus_upload_")` 校验 - 读取最多 4KB,base64 编码返回 - UTF-8 检测: 成功则 `encoding_hint="text"`, 否则 `"binary"` - 超过 1MB 的文件不支持预览 - 审计日志记录 - `server/api/schemas.py` — 新增 `LocalFilePreview` 模型 ### 前端 - `web/app/push.html` — 5 项改动 - F5: 同步模式 radio 组下方 `