feat: 资产同步状态与同步轨迹入口-新
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m35s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m35s
This commit is contained in:
@@ -1,32 +1,30 @@
|
||||
# Change: 资产同步状态与同步轨迹入口
|
||||
# Change: 调整资产同步状态与同步轨迹入口
|
||||
|
||||
## Why
|
||||
|
||||
当前资产信息页虽保留了手动刷新能力和部分同步时间展示,但运营无法直观看到资产当前轮询策略、最近活跃情况及下次轮询时间,也没有可直接进入该资产同步轨迹的入口。
|
||||
运营需要通过统一审计查看资产业务事件、运营商回调和周期轮询的同步轨迹。新需求明确资产信息页只保留已有手动刷新和轮询展示,不新增用于推断轮询计划的状态字段。
|
||||
|
||||
## What Changes
|
||||
|
||||
- 在资产信息页的卡和设备详情中新增同步状态区域,展示轮询启用状态、活跃级别、最后活跃时间、最后活跃场景和下次轮询时间。
|
||||
- 复用 `GET /api/admin/assets/resolve/{identifier}` 的新增 `polling` 响应对象;无下次轮询时间时展示 `-`。
|
||||
- 保留现有手动刷新按钮及其接口契约,不新增第二个同步或刷新按钮。
|
||||
- 新增“查看同步轨迹”入口,跳转全局审计外部集成页并带入当前资产的筛选参数。
|
||||
- 同步轨迹由目标页面按立即、3分钟、5分钟连续结果展示;本提案不改造全局审计外部集成页面本身。
|
||||
- 保留卡和设备资产信息页现有的手动刷新按钮、接口契约和轮询状态展示,不新增第二个同步或刷新按钮。
|
||||
- 不展示活跃级别、最后活跃场景或下次轮询时间,也不根据事件轨迹推算新的周期轮询时间。
|
||||
- 增加“查看同步轨迹”入口,跳转全局审计外部集成页并带入当前资产的 `resource_type` 和 `resource_key` 筛选参数。
|
||||
- 约定审计查询支持 `resource_type`、`resource_key`、`correlation_id`,以供目标页连续展示立即、3分钟、5分钟的同步结果,以及运营商回调和周期轮询的 Integration Log。
|
||||
- 对 `rate_limited` 手动刷新结果仅展示本次失败,不展示自动退避倒计时。
|
||||
- 全局审计外部集成页面自身暂不在本提案中开发或改造。
|
||||
|
||||
## Impact
|
||||
|
||||
- Affected specs: `asset-information`
|
||||
- Related active changes: `update-asset-realtime-sync-timestamps-display`(共享资产同步展示区域)
|
||||
- Related active changes: `update-asset-realtime-sync-timestamps-display`(共享资产同步信息展示)
|
||||
- Affected code:
|
||||
- `src/types/api/asset.ts`
|
||||
- `src/api/modules/asset.ts`
|
||||
- `src/views/asset-management/asset-information/**`
|
||||
- `src/views/asset-management/asset-information/components/BasicInfoCard.vue`
|
||||
- `src/views/asset-management/asset-information/index.vue`
|
||||
- 资产信息页到全局审计外部集成页的路由跳转参数
|
||||
- API contracts:
|
||||
- `GET /api/admin/assets/resolve/{identifier}`
|
||||
- `POST /api/admin/assets/{identifier}/refresh`(保持既有契约)
|
||||
- `GET /api/admin/audit/integrations`(复用 `resource_type`、`resource_key`、`correlation_id` 查询参数)
|
||||
- Out of scope:
|
||||
- 全局审计外部集成页面自身的开发或改造
|
||||
- 新增第二个同步或刷新按钮
|
||||
- `rate_limited` 的自动退避倒计时展示
|
||||
- 审计轨迹结果页的加载、空记录和失败状态界面实现
|
||||
- 新增轮询活跃级别、最后活跃场景、下次轮询时间或自动退避倒计时展示
|
||||
|
||||
@@ -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 被要求在本提案中开发或改造
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
## 1. API Contract
|
||||
## 1. Asset Sync Controls
|
||||
|
||||
- [x] 1.1 更新资产解析响应类型,支持 `polling.enabled`、`activity_level`、`last_activity_at`、`last_activity_scene`、`next_poll_at`。
|
||||
- [x] 1.2 保持现有资产手动刷新接口与调用方式不变,不新增同步接口或按钮。
|
||||
- [x] 1.3 定义同步轨迹跳转参数,复用 `resource_type`、`resource_key`、`correlation_id` 查询契约。
|
||||
- [x] 1.1 保留卡和设备资产信息页现有手动刷新按钮及其接口调用方式,不新增同步或刷新按钮。
|
||||
- [x] 1.2 保留现有轮询状态展示,移除活跃级别、最后活跃场景和下次轮询时间展示。
|
||||
- [x] 1.3 `rate_limited` 时仅展示本次刷新失败,不展示自动退避倒计时或新的轮询时间。
|
||||
|
||||
## 2. Asset Sync Status UI
|
||||
## 2. Sync Trail Navigation
|
||||
|
||||
- [x] 2.1 在卡和设备资产信息页新增同步状态区域,展示轮询是否启用、活跃级别、最后活跃时间、最后活跃场景和下次轮询时间。
|
||||
- [x] 2.2 为空的 `last_activity_at`、`last_activity_scene`、`next_poll_at` 提供稳定占位;无下次轮询时间显示 `-`。
|
||||
- [x] 2.3 保留现有手动刷新按钮;`rate_limited` 时仅展示本次失败结果,不显示自动退避倒计时。
|
||||
- [x] 2.1 在卡和设备资产信息页增加“查看同步轨迹”入口,跳转全局审计外部集成页。
|
||||
- [x] 2.2 跳转时带入当前资产的 `resource_type` 和 `resource_key` 筛选参数。
|
||||
- [x] 2.3 前端不根据事件轨迹推算或展示新的周期轮询时间。
|
||||
|
||||
## 3. Sync Trail Navigation
|
||||
## 3. Audit Integration Contract
|
||||
|
||||
- [x] 3.1 增加受 `asset_info:view_sync_trail` 按钮权限控制的“查看同步轨迹”入口,跳转全局审计外部集成页并带入当前资产筛选。
|
||||
- [ ] 3.2 确保跳转筛选可支持立即、3分钟、5分钟连续同步结果的轨迹查询(当前仓库未提供全局审计外部集成页,待目标页接入后联调)。
|
||||
- [ ] 3.3 不改造全局审计外部集成页面本身。
|
||||
- [ ] 3.1 与审计接口确认并联调 `resource_type`、`resource_key`、`correlation_id` 查询参数。
|
||||
- [ ] 3.2 确认目标查询可覆盖立即、3分钟、5分钟的连续同步结果,以及运营商回调和周期轮询的 Integration Log。
|
||||
- [x] 3.3 不开发或改造全局审计外部集成页面的加载、空记录和失败状态界面。
|
||||
|
||||
## 4. Verification
|
||||
|
||||
- [ ] 4.1 验证卡和设备均可展示完整、部分为空和全部为空的同步状态。
|
||||
- [x] 4.2 验证保留单一手动刷新入口,且 `rate_limited` 不展示倒计时。
|
||||
- [ ] 4.3 验证“查看同步轨迹”跳转携带当前资产筛选并能查看连续同步结果(待全局审计外部集成页提供后联调)。
|
||||
- [ ] 4.1 验证卡和设备均保留既有手动刷新和轮询状态展示,且不显示新增轮询活跃字段。
|
||||
- [ ] 4.2 验证“查看同步轨迹”跳转携带当前资产筛选。
|
||||
- [ ] 4.3 待全局审计外部集成页就绪后,验证过滤后的轨迹加载、空记录、失败状态及连续同步结果完整。
|
||||
- [x] 4.4 运行相关前端校验,并执行 `openspec validate update-asset-sync-status-trail --strict`。
|
||||
|
||||
Reference in New Issue
Block a user