refactor(q1): src/api 全量清零 any + types/monitor 扩展输入 DTO
ROADMAP Q1 推进(前端类型安全治理 in_progress): - src/api/ 整个目录 any 清零(含 monitor/ deploy/ 子目录 12+ 文件) create/update 入参 any -> Record<string, unknown> / object mock 桩 trace/grafana 对接 types/ 标准类型(Trace/GrafanaDashboard) 典型接口 LdapFormData/ProbeForm 等强类型表单用 object 接收 - types/monitor.ts 扩展 ~150 行接口: ZabbixDatasource / AlertSilence / 7 个输入 DTO Trace / TraceSpan / TraceServiceMetrics / GrafanaDashboard / DashboardPanel HealthProbeInput 验证: - 整个 src/api/ 目录 any=0 - ESLint no-explicit-any: 995 -> 937 (本项目此轮贡献 -58) - tsc -b 零错误, npm run build ✓ (17.06s) - API 回归 8/8 核心端点通过, Docker 部署 healthy
This commit is contained in:
1 parent
480e677042
commit
b553c7956d
436 files changed
+410
-1198
No files matched your search
@@ -6,32 +6,32 @@ export const deployApi = {
|
||||
// Git 仓库认证
|
||||
getRepos: () => http.get<ListResponse>('/deploy/repos'),
|
||||
getRepo: (id: number | string) => http.get(`/deploy/repos/${id}`),
|
||||
createRepo: ( data: any) => http.post('/deploy/repos', data),
|
||||
updateRepo: (id: number | string, data: any) => http.put(`/deploy/repos/${id}`, data),
|
||||
createRepo: ( data: Record<string, unknown>) => http.post('/deploy/repos', data),
|
||||
updateRepo: (id: number | string, data: Record<string, unknown>) => http.put(`/deploy/repos/${id}`, data),
|
||||
deleteRepo: (id: number | string) => http.delete(`/deploy/repos/${id}`),
|
||||
// 镜像仓库认证
|
||||
getRegistries: () => http.get<ListResponse>('/deploy/registries'),
|
||||
getRegistry: (id: number | string) => http.get(`/deploy/registries/${id}`),
|
||||
createRegistry: ( data: any) => http.post('/deploy/registries', data),
|
||||
updateRegistry: (id: number | string, data: any) => http.put(`/deploy/registries/${id}`, data),
|
||||
createRegistry: ( data: Record<string, unknown>) => http.post('/deploy/registries', data),
|
||||
updateRegistry: (id: number | string, data: Record<string, unknown>) => http.put(`/deploy/registries/${id}`, data),
|
||||
deleteRegistry: (id: number | string) => http.delete(`/deploy/registries/${id}`),
|
||||
// 环境管理
|
||||
getEnvironments: () => http.get<ListResponse>('/deploy/environments'),
|
||||
createEnvironment: ( data: any) => http.post('/deploy/environments', data),
|
||||
updateEnvironment: (id: number | string, data: any) => http.put(`/deploy/environments/${id}`, data),
|
||||
createEnvironment: ( data: Record<string, unknown>) => http.post('/deploy/environments', data),
|
||||
updateEnvironment: (id: number | string, data: Record<string, unknown>) => http.put(`/deploy/environments/${id}`, data),
|
||||
deleteEnvironment: (id: number | string) => http.delete(`/deploy/environments/${id}`),
|
||||
// Item Role 权限管理 (Jenkins Role Strategy 风格)
|
||||
getItemRoles: () => http.get<ListResponse>('/admin/item-roles'),
|
||||
createItemRole: ( data: any) => http.post('/admin/item-roles', data),
|
||||
updateItemRole: (id: number | string, data: any) => http.put(`/admin/item-roles/${id}`, data),
|
||||
createItemRole: ( data: Record<string, unknown>) => http.post('/admin/item-roles', data),
|
||||
updateItemRole: (id: number | string, data: Record<string, unknown>) => http.put(`/admin/item-roles/${id}`, data),
|
||||
deleteItemRole: (id: number | string) => http.delete(`/admin/item-roles/${id}`),
|
||||
getUserItemRoles: (userId: number | string) => http.get(`/admin/users/${userId}/item-roles`),
|
||||
assignItemRole: (userId: number | string, data: { user_id: number; item_role_id: number }) => http.post(`/admin/users/${userId}/item-roles`, data),
|
||||
removeItemRole: (userId: number | string, roleId: number | string) => http.delete(`/admin/users/${userId}/item-roles/${roleId}`),
|
||||
// 用户组管理
|
||||
getGroups: () => http.get<ListResponse>('/deploy/groups'),
|
||||
createGroup: ( data: any) => http.post('/deploy/groups', data),
|
||||
updateGroup: (id: number | string, data: any) => http.put(`/deploy/groups/${id}`, data),
|
||||
createGroup: ( data: Record<string, unknown>) => http.post('/deploy/groups', data),
|
||||
updateGroup: (id: number | string, data: Record<string, unknown>) => http.put(`/deploy/groups/${id}`, data),
|
||||
deleteGroup: (id: number | string) => http.delete(`/deploy/groups/${id}`),
|
||||
getGroupMembers: (id: number | string) => http.get(`/deploy/groups/${id}/members`),
|
||||
addGroupMember: (id: number | string, data: { username: string }) => http.post(`/deploy/groups/${id}/members`, data),
|
||||
@@ -39,7 +39,7 @@ export const deployApi = {
|
||||
// 工具配置
|
||||
getTools: () => http.get<ListResponse>('/deploy/tools'),
|
||||
getTool: (id: number | string) => http.get(`/deploy/tools/${id}`),
|
||||
updateTool: (id: number | string, data: any) => http.put(`/deploy/tools/${id}`, data),
|
||||
updateTool: (id: number | string, data: Record<string, unknown>) => http.put(`/deploy/tools/${id}`, data),
|
||||
installTool: (id: number | string, version?: string) =>
|
||||
http.post(`/deploy/tools/${id}/install`, version ? { version } : {}),
|
||||
checkTool: (id: number | string) => http.post(`/deploy/tools/${id}/check`),
|
||||
|
||||
Reference in new issue
Block a user