From 037a6c8e4d2df4cc4d3c1034b6998d191be7a630 Mon Sep 17 00:00:00 2001 From: liuzx Date: Tue, 28 Dec 2021 17:09:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=AE=BF=E9=97=AE=E9=87=8F?= =?UTF-8?q?=E7=9A=84=E9=99=90=E5=AE=9A=E9=A1=B5=E9=9D=A2=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=88=B0ini=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/repository/elk_pagedata.go | 19 ++++--------------- modules/setting/setting.go | 14 ++++++++------ 2 files changed, 12 insertions(+), 21 deletions(-) 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 2d70e47b1..79a33b819 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -508,12 +508,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 @@ -1308,6 +1309,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()