diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index a4bf506..8b92790 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -136,7 +136,7 @@ export const serverApi = { batchDelete: async (ids: number[]) => { return http.post('/servers/batch-delete', { ids }); }, - batchCreate: async (data: { servers: any[]; region_id?: string; auth_type?: string; credential_id?: number }) => { + batchCreate: async (data: { servers: any[]; region_id?: string; auth_type?: string; credential_id?: number; default_port?: number }) => { return http.post('/servers/batch', data); }, getMetrics: async (id: number | string) => { @@ -414,8 +414,8 @@ export const cloudApi = { return http.post<{ list: any[]; total: number; errors: string[] }>(`/cloud-accounts/${id}/discover-instances`, { regions }); }, // 导入选中的云主机实例为本地服务器 - importInstances: async (id: number | string, instances: any[]) => { - return http.post<{ imported: number; skipped: number }>(`/cloud-accounts/${id}/import-instances`, { instances }); + importInstances: async (id: number | string, instances: any[], opts?: { default_port?: number; credential_id?: number }) => { + return http.post<{ imported: number; skipped: number }>(`/cloud-accounts/${id}/import-instances`, { instances, ...opts }); }, getDomains: async (params?: { page?: number; page_size?: number; keyword?: string }) => { return http.get('/domains', params);