refactor: 数据源弹框交互重构 + test-connection API
1. 类型选择前置: 4个数据源类型卡片(MySQL/PG/Redis/Mongo)放最前面 2. 根据类型动态渲染: Redis隐藏用户名/数据库, 显示数据库编号 3. 环境支持自定义输入: 预设开发/预发/生产/测试/UAT + 自定义... 4. 去掉流程配置: 不再需要配置审批流程 5. 测试连接优先: 底部左侧「测试连接」按钮, 连接成功后才能「添加数据源」 6. 后端新增 POST /test-connection: 不保存实例直接测试连接参数 7. 类型切换自动填充默认端口: mysql:3306, pg:5432, redis:6379, mongo:27017 8. 连接测试结果展示: 成功(绿色+版本号) / 失败(红色+错误信息) 9. 修改连接参数时自动清除测试结果, 需重新测试 前端构建零错误, 后端202测试通过
This commit is contained in:
1 parent
f8ae3b92e5
commit
e0cb505d43
3 files changed
+205
-122
No files matched your search
@@ -7,6 +7,7 @@ export const instanceApi = {
|
||||
update: (id: number, data: any) => request.put<any, any>(`/instances/${id}`, data),
|
||||
delete: (id: number) => request.delete(`/instances/${id}`),
|
||||
testConnection: (id: number) => request.post<any, any>(`/instances/${id}/test`),
|
||||
testNewConnection: (data: any) => request.post<any, any>('/instances/test-connection', data),
|
||||
listDatabases: (id: number) => request.get<any, string[]>(`/instances/${id}/databases`),
|
||||
listTables: (id: number, db: string) => request.get<any, any[]>(`/instances/${id}/databases/${db}/tables`),
|
||||
};
|
||||
Reference in new issue
Block a user