diff --git a/modules/repository/elk_pagedata.go b/modules/repository/elk_pagedata.go index ecdbff078..f4538bf62 100644 --- a/modules/repository/elk_pagedata.go +++ b/modules/repository/elk_pagedata.go @@ -162,21 +162,10 @@ func ProjectViewInit(User string, Project string, Gte string, Lte string) (proje inputStruct.Batch[0].Request.Params.Body.Query.BoolIn.Filter[2].FilterMatchPhrase = &projectName //限定页面 var bool Bool - bool.Should = make([]Should, 14) - bool.Should[0].MatchPhrase.TagName = "%{[request][3]}" - bool.Should[1].MatchPhrase.TagName = "datasets?type=0" - bool.Should[2].MatchPhrase.TagName = "datasets?type=1" - bool.Should[3].MatchPhrase.TagName = "issues" - bool.Should[4].MatchPhrase.TagName = "labels" - bool.Should[5].MatchPhrase.TagName = "pulls" - bool.Should[6].MatchPhrase.TagName = "wiki" - bool.Should[7].MatchPhrase.TagName = "activity" - bool.Should[8].MatchPhrase.TagName = "cloudbrain" - bool.Should[9].MatchPhrase.TagName = "modelarts" - bool.Should[10].MatchPhrase.TagName = "blockchain" - bool.Should[11].MatchPhrase.TagName = "watchers" - bool.Should[12].MatchPhrase.TagName = "stars" - bool.Should[13].MatchPhrase.TagName = "forks" + bool.Should = make([]Should, len(setting.PROJECT_LIMIT_PAGES)) + for i, pageName := range setting.PROJECT_LIMIT_PAGES { + bool.Should[i].MatchPhrase.TagName = pageName + } inputStruct.Batch[0].Request.Params.Body.Query.BoolIn.Filter[3].Bool = &bool return inputStruct } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index cf6d9dbf5..e7ab0b7d2 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -516,12 +516,13 @@ var ( TrainJobFLAVORINFOS string //elk config - ElkUrl string - ElkUser string - ElkPassword string - Index string - TimeField string - ElkTimeFormat string + ElkUrl string + ElkUser string + ElkPassword string + Index string + TimeField string + ElkTimeFormat string + PROJECT_LIMIT_PAGES []string //nginx proxy PROXYURL string @@ -1324,6 +1325,7 @@ func NewContext() { Index = sec.Key("INDEX").MustString("") TimeField = sec.Key("TIMEFIELD").MustString(" @timestamptest") ElkTimeFormat = sec.Key("ELKTIMEFORMAT").MustString("date_time") + PROJECT_LIMIT_PAGES = strings.Split(sec.Key("project_limit_pages").MustString(""), ",") SetRadarMapConfig()