Files
2026-08-11 13:32:21 +08:00

1.2 KiB
Raw Permalink Blame History

同步任务检查页面设计

Feature 接口

新增 features/sync/api 三件套:types、request adapters、React Query hooks。页面只调用 hooks; query keys 统一以 marketIntegrity 开头。

  • latest query:进入页面获取最近检查;
  • check query:running 时按 id 周期轮询,终态停止;
  • trigger mutation:POST 成功后写入/失效相关 query cache 并切换到该 id。

页面状态

  • no_data:解释检查范围并提供“开始完整性检查”。
  • running:进度条、checked/target、问题数、开始时间,按钮禁用。
  • passed:完成摘要和“未发现 PostgreSQL/CSV 不一致”。
  • issues_found:完成摘要、只报告提示和分页问题表。
  • failed:安全错误、重新发起入口;不会声称市场数据损坏。

409 时刷新 latest 并接管已有 running;其他错误保留 ApiError 状态和用户可见重试。页面刷新通过 latest 恢复 active id,不需要 localStorage/Zustand。

路由与可访问性

/sync 加入 route tree、navigation 和 routePresentation;AppLayout active route 识别该路径。按钮、 进度、状态和问题列表使用可访问标签,焦点不因 polling 被重置。