feat: 工具配置增强、站点拨测与日志中心多项改进

- 工具配置:新增卸载 API/UI、Go 工具链、流水线构建自动安装依赖
- 修复 ListTools VerifyTool 递归栈溢出导致获取工具配置失败
- Node.js Alpine 安装改用 unofficial-builds musl 预编译包与 index.json 解析 LTS
- 站点拨测:详情页路由、告警自动恢复、并发拨测与默认可观测频率
- 日志中心:RBAC、查询构建器、ES/Loki 增强与审计 request/response 展示
- 发布配置:构建节点、流水线远程执行、Deploy RBAC 导航拆分
This commit is contained in:
Logan committed 2026-07-02 07:47:33 +08:00
1 parent cde7bbe540
commit 7e1c8f583c
84 files changed
+7729 -1507

No files matched your search

+32 -9
View File
@@ -27,12 +27,19 @@ type Pipeline struct {
// 并发控制
MaxExecutors int `gorm:"default:2;comment:最大并发执行数(1=串行,默认2)" json:"max_executors"`
// 构建节点(nil=自动调度 Master 优先,非 nil=指定节点 ID) // Logan.Li
BuildNodeID *uint `json:"build_node_id,omitempty"`
// SSH 部署目标服务器 (JSON: [1,2,3])
ServerIDs string `gorm:"type:text;comment:SSH服务器ID列表(JSON)" json:"server_ids,omitempty"`
ServerIDs string `gorm:"type:text;comment:SSH服务器ID列表(JSON)" json:"server_ids,omitempty"`
DeployRemotePath string `gorm:"size:255;comment:SSH部署远程目录" json:"deploy_remote_path,omitempty"`
DeployScript string `gorm:"type:text;comment:SSH部署后执行命令" json:"deploy_script,omitempty"`
// K8s 部署目标
K8sClusterID *uint `json:"k8s_cluster_id,omitempty"` // FK → kubernetes_clusters
K8sNamespace string `gorm:"size:128;comment:K8s部署命名空间" json:"k8s_namespace,omitempty"`
K8sClusterID *uint `json:"k8s_cluster_id,omitempty"` // FK → kubernetes_clusters
K8sNamespace string `gorm:"size:128;comment:K8s部署命名空间" json:"k8s_namespace,omitempty"`
K8sDeployment string `gorm:"size:128;comment:K8s Deployment 名称" json:"k8s_deployment,omitempty"`
K8sContainerName string `gorm:"size:128;comment:K8s更新镜像目标容器" json:"k8s_container_name,omitempty"`
// 仓库和镜像仓库关联(旧字段,待废弃)
RepoID *uint `json:"repo_id"` // FK → deploy_pipeline_repos
@@ -87,6 +94,8 @@ type PipelineRun struct {
ImageTag string `gorm:"size:255" json:"image_tag"` // 构建产物镜像标签
ArtifactURL string `gorm:"size:500" json:"artifact_url"` // 构建产物地址
WorkspacePath string `gorm:"size:500" json:"workspace_path"` // 工作区路径
BuildNodeID *uint `json:"build_node_id,omitempty"` // 实际执行节点(0/nil=Master)
BuildNodeName string `gorm:"size:64" json:"build_node_name,omitempty"`
Duration int `json:"duration"` // 秒
Stages string `gorm:"type:text" json:"stages"` // JSON
Logs string `gorm:"type:longtext" json:"logs"`
@@ -153,9 +162,13 @@ type CreatePipelineRequest struct {
// 部署模式
DeployMode string `json:"deploy_mode"` // branch / tag
DeployTarget string `json:"deploy_target"` // ssh / k8s
ServerIDs string `json:"server_ids"` // SSH 服务器ID JSON [1,2,3]
K8sClusterID *uint `json:"k8s_cluster_id"`
K8sNamespace string `json:"k8s_namespace"`
ServerIDs string `json:"server_ids"` // SSH 服务器ID JSON [1,2,3]
DeployRemotePath string `json:"deploy_remote_path"`
DeployScript string `json:"deploy_script"`
K8sClusterID *uint `json:"k8s_cluster_id"`
K8sNamespace string `json:"k8s_namespace"`
K8sDeployment string `json:"k8s_deployment"`
K8sContainerName string `json:"k8s_container_name"`
RepoID *uint `json:"repo_id"`
RegistryID *uint `json:"registry_id"`
@@ -176,6 +189,9 @@ type CreatePipelineRequest struct {
// 并发控制
MaxExecutors int `json:"max_executors"`
// 构建节点
BuildNodeID *uint `json:"build_node_id"`
}
// UpdatePipelineRequest 更新流水线请求
@@ -191,9 +207,13 @@ type UpdatePipelineRequest struct {
Variables string `json:"variables"`
DeployMode string `json:"deploy_mode"`
DeployTarget string `json:"deploy_target"`
ServerIDs string `json:"server_ids"`
K8sClusterID *uint `json:"k8s_cluster_id"`
K8sNamespace string `json:"k8s_namespace"`
ServerIDs string `json:"server_ids"`
DeployRemotePath string `json:"deploy_remote_path"`
DeployScript string `json:"deploy_script"`
K8sClusterID *uint `json:"k8s_cluster_id"`
K8sNamespace string `json:"k8s_namespace"`
K8sDeployment string `json:"k8s_deployment"`
K8sContainerName string `json:"k8s_container_name"`
RepoID *uint `json:"repo_id"`
RegistryID *uint `json:"registry_id"`
// 凭证关联
@@ -212,6 +232,9 @@ type UpdatePipelineRequest struct {
// 并发控制
MaxExecutors int `json:"max_executors"`
// 构建节点(传 null 清除绑定)
BuildNodeID *uint `json:"build_node_id"`
}
// TriggerPipelineRequest 触发流水线请求