监控主题工作区
路由:/topics。视觉与结构依据:Figma桌面原稿 。旧页面不是视觉验收基线;代码和现有数据库只用于确认可复用合同与运行依赖。
用户任务
在同一屏理解主题关键词、采集平台、命中变化和告警,并进入必要设置。
页面数据、功能与持久化
| 区域/操作 | 必需字段 | 数量与范围 | 当前实现及持久化决定 |
|---|---|---|---|
| 主题列表 | id/name/status、频率、搜索/新建 | 20条/页,桌面330px列 | 复用monitor_topics;已归档通过次级筛选查看 |
| 标题/关键词 | name、status、interval、match_any/match_all/exclude | 选中1主题 | 标题与关键词直接展示;不是四页签默认结果页 |
| 每小时命中 | hour、new_items、coverage、snapshot_at | 24小时桶 | 当前接口缺失;最近5条结果不是小时总量 |
| 采集平台 | key/name、支持能力、准入、选中、最近成功/条数 | 原稿8行;实际以来源目录为准 | 开关进入草稿设置并明确保存;不可用来源不能伪装启用 |
| 告警规则 | rule_id/阈值/window/channel、enabled | 当前主题规则 | 复用规则与版本;其他主题不得混入 |
| 最近告警 | evaluation_id、事件/时间/状态、read_at | 最近可读历史,按规则最多50 | 评估历史按需读取;已读操作无合同,禁用而不假写 |
| 次级操作 | 结果、采集运行、编辑设置 | 展开区保持草稿和运行回执 | 已有预览/版本冲突/幂等运行/恢复链保留 |
替换边界
移除默认“结果/采集/告警/设置”四页签;主视图连续展示原稿区域,结果与编辑作为次级展开区,兼容旧tab深链接。命中统计、已读与平台成功摘要是服务待补项。
接口与业务落点
下列为本页业务读取/提交入口。全局会话、头像、站点元信息和共享组件中未在本页触发的导出函数不算新增页面能力。请求类型、响应与错误以生成客户端和后端为准。
| 页面调用 | 方法和路径 | 请求 → 响应合同 | 实现依据 |
|---|---|---|---|
archiveMonitorTopic | POST /api/topics/{topic_id}/archive | archiveMonitorTopicParams → MonitorTopicView | 客户端 · 后端 |
cloneMonitorTopic | POST /api/topics/{topic_id}/clone | cloneMonitorTopicParams → MonitorTopicView | 客户端 · 后端 |
getMonitorTopic | GET /api/topics/{topic_id} | getMonitorTopicParams → MonitorTopicView | 客户端 · 后端 |
getReportEmailSubscription | GET /api/notifications/email-subscription | 无业务入参 → ReportEmailSubscriptionView | 客户端 · 后端 |
listAlertHistory | GET /api/alerts/{rule_id}/history | listAlertHistoryParams → AlertEvaluationView[] | 客户端 · 后端 |
listAlerts | GET /api/alerts | 无业务入参 → AlertRuleView[] | 客户端 · 后端 |
listContentRecords | GET /api/contents | listContentRecordsParams → PageViewContentRecordSummaryView_ | 客户端 · 后端 |
listMonitorEditorialSources | GET /api/topics/editorial-sources | 无业务入参 → EditorialTopicSourceView[] | 客户端 · 后端 |
listMonitorTopics | GET /api/topics | listMonitorTopicsParams → PageViewMonitorTopicView_ | 客户端 · 后端 |
listSourceCapabilities | GET /api/source-capabilities | 无业务入参 → PageViewSourcePlatformView_ | 客户端 · 后端 |
pauseMonitorTopic | POST /api/topics/{topic_id}/pause | pauseMonitorTopicParams → MonitorTopicView | 客户端 · 后端 |
previewMonitorTopic | POST /api/topics/preview | MonitorTopicPreviewInput → MonitorTopicPreviewView | 客户端 · 后端 |
previewMonitorTopicSamples | POST /api/topics/sample-preview | ContentSamplePreviewInput → ContentSamplePreviewView | 客户端 · 后端 |
resumeMonitorTopic | POST /api/topics/{topic_id}/resume | resumeMonitorTopicParams → MonitorTopicView | 客户端 · 后端 |
runMonitorTopic | POST /api/topics/{topic_id}/runs | runMonitorTopicParams, MonitorTopicRunInput → MonitorTopicRunView | 客户端 · 后端 |
updateMonitorTopic | PATCH /api/topics/{topic_id} | updateMonitorTopicParams, MonitorTopicUpdateInput → MonitorTopicView | 客户端 · 后端 |
数据落点:monitor_topics、monitor_topic_versions、monitor_topic_status_events、monitor_schedules、jobs、content_records、content_topic_matches、alert_rules。这是当前依赖定位,不代表这些表均为重新设计时必须新建;详细字段/键/关系及保留原因见页面数据库设计。
交互、权限与验收
- 正常、空、加载、错误、无权限分别验收;未知数值显示“—”,没有观测不画虚构曲线,过期数据标明时间。
- 对照 Figma 原稿在 1440px / 390px 验收布局、标题、间距、滚动和键盘焦点。组件检查通过不替代视觉评审。
- 页面读取不启动采集、模型或外发通知;写操作显式触发,失败保留输入,版本冲突先重读。公开读取继续执行逐项许可;个人数据 owner 来自会话。
- 设计中存在而服务没有提供的字段是待接入需求,不因旧页面没有该控件而撤销,也不据此预建通用平台。