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:
1 parent
cde7bbe540
commit
7e1c8f583c
84 files changed
+7729
-1507
No files matched your search
@@ -76,7 +76,7 @@ func PipelineAccess(db *gorm.DB) gin.HandlerFunc {
|
||||
func() uint { uid, _ := c.Get("userID"); return uid.(uint) }()).
|
||||
Find(&itemRoles)
|
||||
for _, ir := range itemRoles {
|
||||
if matched, _ := regexp.MatchString(ir.Pattern, code); matched {
|
||||
if pipelineMatchesItemRole(pipeline, ir.Pattern) {
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func GetAccessiblePipelineIDs(db *gorm.DB, username string, userID uint) ([]uint
|
||||
db.Find(&allPipelines)
|
||||
for _, p := range allPipelines {
|
||||
for _, ir := range itemRoles {
|
||||
if matched, _ := regexp.MatchString(ir.Pattern, p.Code); matched {
|
||||
if pipelineMatchesItemRole(p, ir.Pattern) {
|
||||
idSet[p.ID] = true
|
||||
break
|
||||
}
|
||||
@@ -137,3 +137,19 @@ func GetAccessiblePipelineIDs(db *gorm.DB, username string, userID uint) ([]uint
|
||||
|
||||
return ids, len(ids) > 0
|
||||
}
|
||||
|
||||
// pipelineMatchesItemRole 正则匹配流水线 code 或 Job 名称(Webhook Job) // Logan.Li
|
||||
func pipelineMatchesItemRole(p model.Pipeline, pattern string) bool {
|
||||
if pattern == "" {
|
||||
return false
|
||||
}
|
||||
if matched, err := regexp.MatchString(pattern, p.Code); err == nil && matched {
|
||||
return true
|
||||
}
|
||||
if p.JobName != "" {
|
||||
if matched, err := regexp.MatchString(pattern, p.JobName); err == nil && matched {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in new issue
Block a user