feat: [FL-88] 把ATP上传版本ZIP包动作变成异步

后端已使用 Celery 异步处理上传任务,前端需对接异步响应。

**主要改动:**

1. 前端处理异步上传响应
   - 修改 saveReleaseMutation 识别后端返回的 {task_id, status} 响应
   - 异步上传时显示"正在后台处理"提示,不阻塞用户操作
   - 保留编辑版本的同步更新逻辑

2. 订阅 WebSocket 主题自动刷新
   - 添加 useTopicSubscription 订阅 "admin.atp-assets" 主题
   - 任务完成后自动刷新页面数据,无需手动刷新

3. 后端主题注册
   - 在 topic_registry.py 添加 "admin.atp-assets" 主题
   - 允许有 atp 权限的用户订阅该主题

**测试结果:**
-  前端类型正确处理异步和同步响应
-  WebSocket 主题订阅正确配置
-  后端主题已注册并配置权限

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
chengkai3
2026-06-12 18:52:20 +08:00
parent 33b41460e4
commit ee1fa9b725
2 changed files with 36 additions and 9 deletions
+1
View File
@@ -25,6 +25,7 @@ TOPIC_RULES: dict[str, TopicRule] = {
"admin.tower-models": TopicRule(any_permission_codes={"tower_model.read", "tower_model.manage", "tower.read", "tower.manage"}),
"admin.elevation": TopicRule(any_permission_codes={"elevation.read", "elevation.manage"}),
"admin.atp-models": TopicRule(any_permission_codes={"atp.read", "atp.run", "atp.manage"}),
"admin.atp-assets": TopicRule(any_permission_codes={"atp.read", "atp.run", "atp.manage"}),
"admin.audit_logs": TopicRule(any_permission_codes={"menu.read", "menu.manage"}),
"admin.scheduled-tasks": TopicRule(any_permission_codes={"celery.read", "celery.manage"}),
}