feat: Docker部署 + 云主机导入 + 终端优化
Docker 部署: - 新增根目录 docker-compose.yml(MySQL+Redis+前后端四容器) - 新增 frontend/Dockerfile(多阶段构建)和 nginx.conf(SPA+API反代) - 修复 backend/Dockerfile:GOPROXY国内加速、编译整个cmd包 云主机导入功能: - 新增 backend/internal/cloud 包:Provider接口 + 阿里云API客户端 - 新增 cloud_sync.go:区域同步/主机发现/导入 API - 重写 CloudServerImport.tsx:4步流程(选云→选账号→选区域→发现导入) - 修复导入外键约束失败(region_id/cloud_id 设为 NULL) 终端优化: - 修复双X关闭按钮重影(showCloseButton=false) - 修复最大化→最小化不恢复(ResizeObserver + 禁用CSS过渡) 其他: - GORM AutoMigrate 逐表迁移,避免索引冲突阻塞启动 - Makefile 更新为 AIOps + 新增 docker 命令组 - .env.example 移至 backend 目录
This commit is contained in:
1 parent
2e175daf80
commit
d0344c2f52
14 files changed
+1265
-200
No files matched your search
@@ -390,6 +390,23 @@ export const cloudApi = {
|
||||
deleteAccount: async (id: number | string) => {
|
||||
return http.delete(`/cloud-accounts/${id}`);
|
||||
},
|
||||
// ==================== 云同步 API ====================
|
||||
// 同步云账号的区域列表到本地
|
||||
syncRegions: async (id: number | string) => {
|
||||
return http.post(`/cloud-accounts/${id}/sync-regions`);
|
||||
},
|
||||
// 获取云账号的区域列表
|
||||
getAccountRegions: async (id: number | string) => {
|
||||
return http.get<ListResponse>(`/cloud-accounts/${id}/regions`);
|
||||
},
|
||||
// 发现指定区域的云主机实例
|
||||
discoverInstances: async (id: number | string, regions: string[]) => {
|
||||
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 });
|
||||
},
|
||||
getDomains: async (params?: { page?: number; page_size?: number; keyword?: string }) => {
|
||||
return http.get<ListResponse>('/domains', params);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user