fix: API类型兼容 default_port + importInstances opts 参数
This commit is contained in:
1 parent
11e8c24f37
commit
0d61be1413
1 file changed
+3
-3
@@ -136,7 +136,7 @@ export const serverApi = {
|
|||||||
batchDelete: async (ids: number[]) => {
|
batchDelete: async (ids: number[]) => {
|
||||||
return http.post('/servers/batch-delete', { ids });
|
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);
|
return http.post('/servers/batch', data);
|
||||||
},
|
},
|
||||||
getMetrics: async (id: number | string) => {
|
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 });
|
return http.post<{ list: any[]; total: number; errors: string[] }>(`/cloud-accounts/${id}/discover-instances`, { regions });
|
||||||
},
|
},
|
||||||
// 导入选中的云主机实例为本地服务器
|
// 导入选中的云主机实例为本地服务器
|
||||||
importInstances: async (id: number | string, instances: any[]) => {
|
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 });
|
return http.post<{ imported: number; skipped: number }>(`/cloud-accounts/${id}/import-instances`, { instances, ...opts });
|
||||||
},
|
},
|
||||||
getDomains: async (params?: { page?: number; page_size?: number; keyword?: string }) => {
|
getDomains: async (params?: { page?: number; page_size?: number; keyword?: string }) => {
|
||||||
return http.get<ListResponse>('/domains', params);
|
return http.get<ListResponse>('/domains', params);
|
||||||
|
|||||||
Reference in new issue
Block a user