资源排行去掉内置租户 (#544)
Co-authored-by: alickliming <alickliming@didi.global.com>
This commit is contained in:
parent
b7284ada94
commit
7bfd60be86
|
@ -602,7 +602,7 @@ func tenantResourcesCountRank(c *gin.Context) {
|
|||
resMap := make(map[string]int, 50)
|
||||
for _, res := range ress {
|
||||
tenant := res.Tenant
|
||||
if tenant != "" {
|
||||
if tenant != "" && tenant != "inner" {
|
||||
if _, ok := resMap[tenant]; !ok {
|
||||
resMap[tenant] = 0
|
||||
}
|
||||
|
@ -650,9 +650,17 @@ func projectResourcesCountRank(c *gin.Context) {
|
|||
}
|
||||
|
||||
// 获取全部project
|
||||
projectNodes, err := models.NodeGets("cate=?", "project")
|
||||
projectAllNodes, err := models.NodeGets("cate=?", "project")
|
||||
dangerous(err)
|
||||
|
||||
var projectNodes []models.Node
|
||||
for _, p := range projectAllNodes {
|
||||
tenant := p.Tenant()
|
||||
if tenant != "inner" {
|
||||
projectNodes = append(projectNodes, p)
|
||||
}
|
||||
}
|
||||
|
||||
projectNodesLen := len(projectNodes)
|
||||
workerNum := 50
|
||||
if projectNodesLen < workerNum {
|
||||
|
|
Loading…
Reference in New Issue