6.4 KiB
ADDED Requirements
Requirement: 最新轮询配置保存契约
The admin frontend SHALL align create/update/list/detail and preview with the latest configuration fields, including asset/package matching, pre-reset window, four tri-state intervals, clear_fields and save warnings. It MUST remove protect_check_interval and must not confuse zero with null or silently discard successful-save warnings. Existing routes and permissions MUST be preserved.
Scenario: 保存及清空
- WHEN 用户保存新增条件、禁用间隔或清空可空字段
- THEN 前端 MUST 使用明确的更新字段和 clear_fields,保留 0、false,展示实际 warnings
- AND 不得继续发送保护期间隔,预览必须与同一次编辑值一致。
Requirement: 保护期移除与兼容
The frontend SHALL remove deprecated protection-period input and UI in this repository while tolerating device_protect_status in old responses. It MUST disclose that the independently deployed C-end code is outside this repository rather than claim to modify it.
Scenario: 旧响应兼容
- WHEN 后台详情仍返回固定 none 的保护期字段
- THEN 页面 MUST 不显示保护期,不因废弃字段缺失影响资产查询或其他功能。
Requirement: 账户调度、场景与状态排查
The frontend SHALL provide carrier scheduling parameter list/detail, request-check scenes, carrier queue monitoring and single-card polling state with the documented effective/configured values, queue states, confirmations and stop/resume commands. Superadmin-only writes MUST be guarded both in UI and handlers. Null defaults and real zeros MUST remain distinct.
Scenario: 调度参数维护
- WHEN 超级管理员修改参数或恢复默认
- THEN 前端 MUST 校验可确定的容量、比例和递增延迟约束,提交对应接口并展示服务端拒绝原因
- AND 普通按钮权限 MUST 不能启用专属写操作。
Scenario: 单卡状态排查
- WHEN 获授权用户从单卡或设备绑定卡查看状态
- THEN 前端 MUST 使用真实 card_id 请求 polling-state,展示各检查类型及 stop_resume_command
- AND 账户级告警 card_id=0 MUST 不得作为有效卡身份进入该入口。
Requirement: 失败告警与停机被拒视图
The frontend SHALL provide ordinary, carrier-summary and stop-refused alert views, details, handled status and platform-only close-polling actions. Only unresolved alerts may be marked handled. The special view MUST hide and omit check_type/error_category/alert_level. Bulk results MUST distinguish success, skipped, failed and unauthorized/nonexistent without suggesting rollback.
Scenario: 切换特殊视图
- WHEN 用户切换到停机被拒
- THEN 请求 MUST 只带该视图支持的筛选,清除旧选择,展示额外设备/停机/套餐/轮询字段
- AND 导出 MUST 使用独立场景与对应权限。
Scenario: 批量关闭
- WHEN 有权限的平台账号确认关闭告警对应卡的轮询
- THEN 前端 MUST 提交合法 alert_ids 和原因,逐项展示结果并刷新
- AND 不能把账户级告警当设备级操作,不能自动重试整批已部分成功的请求。
Requirement: 平台规则演练与实名确认
The frontend SHALL provide platform-only dry-run summary, paginated details, hypothetical carrier controls and export without executing gateway actions. Hypothetical on/off carrier sets MUST not overlap. Real carrier control changes from off to on MUST display the backend impact message and only resubmit with realname_control_confirm after explicit confirmation.
Scenario: 只读演练
- WHEN 用户运行演练或按结果筛选明细
- THEN 前端 MUST 仅请求 dry-run,汇总保留后端定义的范围,不调用真实停复机或修改管控接口
- AND 明细 result 筛选不得被描述为已改变汇总。
Requirement: 轮询开关、清单与 CSV 导入
The frontend SHALL support card/device polling filters, batch toggles, platform pause-history and CSV import workflows. It MUST load impact descriptions from the API before confirmation, require reasons, enforce unique 1–500 asset IDs, preserve false filters, maintain string identifiers and show all item outcomes. Enterprise accounts MUST not invoke batch toggles. Upload purpose and returned key prefix MUST match the documented polling-status-import contract; file limits and async cleanup MUST be enforced.
Scenario: 确认并批量开关
- WHEN 有权限账号选择资产开启或关闭
- THEN 前端 MUST 展示对应 impact 后确认、提交、展示部分成功结果
- AND 风险停机或已销户卡不得获得强制开启选项,403 必须回滚前端开关并保留原状态。
Scenario: 导入任务
- WHEN 平台账号上传带表头的合法 CSV 并确认
- THEN 前端 MUST 先获取预签名、上传成功后再提交任务,保留 ICCID 原文,展示任务与逐行错误
- AND 上传失败不得创建任务,终态、关闭和卸载 MUST 停止自动查询。
Requirement: 系统模式与监控指标
The frontend SHALL add the polling system-config module, support documented JSON editing, display actual rate-limit/scheduler mode, and explain legacy-only concurrency behavior. Gateway monitoring SHALL use the now-defined operation DTOs, show success rates in the correct scale, identify approximate p95/queue-sample limits and not invent missing metrics.
Scenario: 观察模式
- WHEN 接口返回 observe
- THEN 页面 MUST 说明只统计不拦截,区分 would_limit 与真正 rate_limited
- AND 不得因前端接入自动修改生产调度或限流开关。
Requirement: 导出、路由与权限交付
The frontend SHALL integrate the three new export scenes and preserve enable_polling filters for existing card/device exports. New pages, hidden details and export-task routes MUST follow existing menu conventions. Final handoff MUST list actual incremental menu names, URLs, parents and ordinary xxx:xxx button codes, excluding superadmin-exclusive configuration and preserving previous menu codes.
Scenario: 配置交付
- WHEN 实现完成
- THEN 前端 MUST 同步 docs/权限.md 和最终回复中的增量菜单与按钮清单
- AND MUST 区分平台身份限制、普通按钮权限、真实后端验证与本地 mock,以及本仓库外的 C 端同步事项。