support query data use guest

This commit is contained in:
UlricQin 2021-07-16 18:41:11 +08:00
parent 4e791d50d4
commit a7f12ad871
1 changed files with 8 additions and 8 deletions

View File

@ -39,6 +39,13 @@ func configRoutes(r *gin.Engine) {
guest.POST("/auth/login", loginPost)
guest.GET("/auth/logout", logoutGet)
// 开源版本,为了支持图表分享功能,允许匿名查询数据
guest.POST("/query", GetData)
guest.POST("/tag-pairs", GetTagPairs)
guest.POST("/tag-keys", GetTagKeys)
guest.POST("/tag-values", GetTagValues)
guest.POST("/tag-metrics", GetMetrics)
}
// for brower, expose location in nginx.conf
@ -118,7 +125,7 @@ func configRoutes(r *gin.Engine) {
pages.PUT("/chart/:id", login(), chartPut)
pages.DELETE("/chart/:id", login(), chartDel)
pages.PUT("/charts/configs", login(), chartConfigsPut)
pages.GET("/charts/tmps", login(), chartTmpGets)
pages.GET("/charts/tmps", chartTmpGets)
pages.POST("/charts/tmps", login(), chartTmpAdd)
pages.GET("/alert-rule-groups", login(), alertRuleGroupGets)
@ -162,13 +169,6 @@ func configRoutes(r *gin.Engine) {
pages.GET("/tpl/content", tplGet)
pages.GET("/status", Status)
pages.POST("/query", GetData)
pages.POST("/tag-keys", GetTagKeys)
pages.POST("/tag-values", GetTagValues)
pages.POST("/tag-metrics", GetMetrics)
pages.POST("/tag-pairs", GetTagPairs)
}
// for thirdparty, do not expose location in nginx.conf