Browse Source

Merge pull request '页面访问量的限定页面配置到ini文件,需同时更新ini文件' (#1272) from fix-1211 into V20220110

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1272
Reviewed-by: lewis <747342561@qq.com>
pull/1280/head
lewis 3 years ago
parent
commit
1f18be41f9
2 changed files with 12 additions and 21 deletions
  1. +4
    -15
      modules/repository/elk_pagedata.go
  2. +8
    -6
      modules/setting/setting.go

+ 4
- 15
modules/repository/elk_pagedata.go View File

@@ -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 inputStruct.Batch[0].Request.Params.Body.Query.BoolIn.Filter[2].FilterMatchPhrase = &projectName
//限定页面 //限定页面
var bool Bool 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 inputStruct.Batch[0].Request.Params.Body.Query.BoolIn.Filter[3].Bool = &bool
return inputStruct return inputStruct
} }


+ 8
- 6
modules/setting/setting.go View File

@@ -516,12 +516,13 @@ var (
TrainJobFLAVORINFOS string TrainJobFLAVORINFOS string


//elk config //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 //nginx proxy
PROXYURL string PROXYURL string
@@ -1324,6 +1325,7 @@ func NewContext() {
Index = sec.Key("INDEX").MustString("") Index = sec.Key("INDEX").MustString("")
TimeField = sec.Key("TIMEFIELD").MustString(" @timestamptest") TimeField = sec.Key("TIMEFIELD").MustString(" @timestamptest")
ElkTimeFormat = sec.Key("ELKTIMEFORMAT").MustString("date_time") ElkTimeFormat = sec.Key("ELKTIMEFORMAT").MustString("date_time")
PROJECT_LIMIT_PAGES = strings.Split(sec.Key("project_limit_pages").MustString(""), ",")


SetRadarMapConfig() SetRadarMapConfig()




Loading…
Cancel
Save