feat: 云账号编辑功能 + 通知渠道种子数据 + 修复mock.go编译错误

- 新增 PUT /cloud-accounts/:id 后端端点(UpdateCloudAccount handler + 路由注册)
- 前端 CloudAccountManager 添加编辑弹窗:复用创建表单,凭证留空保持不变
- 修复 scripts/mock.go 编译错误:补充缺失的 generateNotifyChannels 函数(5种通知渠道种子)
- 包含前序未提交的告警通知渠道 CRUD 后端API + AlertManager 通知配置前端UI
This commit is contained in:
attacker committed 2026-06-14 08:16:52 +08:00
1 parent 01a9bebb0c
commit af2e60acd9
9 files changed
+822 -51

No files matched your search

+19
View File
@@ -148,6 +148,22 @@ export const alertApi = {
acknowledge: async (id: number | string) => {
return http.post(`/alerts/${id}/ack`);
},
// 通知渠道管理
getNotifyChannels: async () => {
return http.get('/alerts/notify-channels');
},
createNotifyChannel: async (data: any) => {
return http.post('/alerts/notify-channels', data);
},
updateNotifyChannel: async (id: number | string, data: any) => {
return http.put(`/alerts/notify-channels/${id}`, data);
},
deleteNotifyChannel: async (id: number | string) => {
return http.delete(`/alerts/notify-channels/${id}`);
},
testNotifyChannel: async (id: number | string) => {
return http.post(`/alerts/notify-channels/${id}/test`);
},
};
// ==================== 流水线 API ====================
@@ -311,6 +327,9 @@ export const cloudApi = {
createAccount: async (data: any) => {
return http.post('/cloud-accounts', data);
},
updateAccount: async (id: number | string, data: any) => {
return http.put(`/cloud-accounts/${id}`, data);
},
deleteAccount: async (id: number | string) => {
return http.delete(`/cloud-accounts/${id}`);
},