feat: 资产同步状态与同步轨迹入口-新
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m35s

This commit is contained in:
luo
2026-07-21 11:50:47 +08:00
parent 45d255cabf
commit 6febc66eca
4 changed files with 52 additions and 62 deletions

View File

@@ -1,33 +1,30 @@
## ADDED Requirements
### Requirement: Asset Polling Status Display
### Requirement: Existing Asset Sync Controls and Polling Display
The asset information page SHALL display the current polling status for both card and device assets from the `polling` object returned by `GET /api/admin/assets/resolve/{identifier}`.
The asset information page SHALL preserve the existing manual refresh control and existing polling status display for both card and device assets. The page MUST NOT add another synchronization or refresh control.
#### Scenario: Display complete polling status for a card asset
#### Scenario: Retain existing controls for a card asset
- **GIVEN** 用户正在查看卡资产信息页
- **WHEN** 资产解析响应包含 `polling.enabled``activity_level``last_activity_at``last_activity_scene``next_poll_at`
- **THEN** 页面 MUST 展示轮询是否启用、活跃级别、最后活跃时间、最后活跃场景和下次轮询时间
- **AND** 时间字段 MUST 使用资产信息页统一的时间格式
- **THEN** 页面 MUST 保留现有手动刷新按钮和现有轮询状态展示
- **AND** 页面 MUST NOT 增加第二个同步或刷新按钮
#### Scenario: Display complete polling status for a device asset
#### Scenario: Retain existing controls for a device asset
- **GIVEN** 用户正在查看设备资产信息页
- **WHEN** 资产解析响应包含 `polling` 对象
- **THEN** 页面 MUST 展示轮询是否启用、活跃级别、最后活跃时间、最后活跃场景和下次轮询时间
- **THEN** 页面 MUST 保留现有手动刷新按钮和现有轮询状态展示
- **AND** 页面 MUST NOT 增加第二个同步或刷新按钮
#### Scenario: Display placeholders for unavailable polling values
#### Scenario: Do not display new polling activity fields
- **GIVEN** 用户正在查看卡或设备资产信息页
- **WHEN** `last_activity_at``last_activity_scene``next_poll_at``null`、空字符串或未返回
- **THEN** 页面 MUST 保留对应字段标签
- **AND** `next_poll_at` MUST 显示 `-`
- **AND** 其他不可用字段 MUST 显示稳定占位内容
- **WHEN** 资产解析响应包含 `activity_level``last_activity_scene``next_poll_at`
- **THEN** 页面 MUST NOT 展示活跃级别、最后活跃场景或下次轮询时间字段
### Requirement: Asset Manual Refresh Remains the Only Refresh Entry
The asset information page SHALL preserve the existing manual refresh button and interface contract as the only asset refresh entry.
The asset information page SHALL preserve the existing manual refresh button and interface contract as the only asset refresh entry. The frontend MUST NOT infer or display a future periodic polling time from refresh results or event traces.
#### Scenario: Preserve existing manual refresh behavior
@@ -41,32 +38,36 @@ The asset information page SHALL preserve the existing manual refresh button and
- **THEN** 系统 MUST 仅展示本次请求失败信息
- **AND** 系统 MUST NOT 展示自动退避倒计时
#### Scenario: Do not infer a future polling schedule
- **WHEN** 用户查看刷新结果或同步事件轨迹
- **THEN** 前端 MUST NOT 根据结果推算或展示新的周期轮询时间
### Requirement: Asset Sync Trail Navigation
The asset information page SHALL provide a `查看同步轨迹` entry that navigates to the global audit integration page with filters for the current asset. The target query SHALL support `resource_type`, `resource_key`, and `correlation_id` so the audit page can display the immediate, 3-minute, and 5-minute consecutive sync results for the asset.
The asset information page SHALL provide a `查看同步轨迹` entry that navigates to the global audit integration page with filters for the current asset. The target audit query contract SHALL support `resource_type`, `resource_key`, and `correlation_id` filters.
#### Scenario: Navigate to filtered sync trail from a card asset
- **GIVEN** 用户正在查看卡资产信息页
- **WHEN** 用户点击“查看同步轨迹”
- **THEN** 系统 MUST 跳转到全局审计外部集成页
- **AND** 跳转参数 MUST 带入当前卡资产对应的 `resource_type``resource_key``correlation_id` 筛选信息
- **AND** 跳转参数 MUST 带入当前卡资产对应的 `resource_type``resource_key` 筛选信息
#### Scenario: Navigate to filtered sync trail from a device asset
- **GIVEN** 用户正在查看设备资产信息页
- **WHEN** 用户点击“查看同步轨迹”
- **THEN** 系统 MUST 跳转到全局审计外部集成页
- **AND** 跳转参数 MUST 带入当前设备资产对应的 `resource_type``resource_key``correlation_id` 筛选信息
- **AND** 跳转参数 MUST 带入当前设备资产对应的 `resource_type``resource_key` 筛选信息
#### Scenario: Sync trail includes consecutive polling results
#### Scenario: Audit query filters a correlation group
- **GIVEN** 用户已通过资产信息页进入带筛选的同步轨迹
- **WHEN** 全局审计外部集成页查询该资产轨迹
- **THEN** 查询结果 MUST 支持按立即、3分钟、5分钟连续同步结果展示
- **WHEN** 全局审计外部集成页按一次业务事件的 `correlation_id` 查询同步轨迹
- **THEN** 审计查询契约 MUST 支持该筛选参数
#### Scenario: Audit integration page implementation is out of scope
#### Scenario: Audit target page is outside this change
- **WHEN** 本次变更落地
- **THEN** 资产信息页的同步轨迹跳转入口 MUST 可用
- **AND** 全局审计外部集成页面自身 MUST NOT 被要求在本提案中改造
- **AND** 全局审计外部集成页面的加载、空记录和失败状态界面 MUST NOT 被要求在本提案中开发或改造