@@ -1,9 +1,12 @@ | |||||
package setting | package setting | ||||
import "strings" | |||||
var ScreenMap = struct { | var ScreenMap = struct { | ||||
ShowData bool | |||||
MinValue int | |||||
MaxValue int | |||||
ShowData bool | |||||
MinValue int | |||||
MaxValue int | |||||
ExcludeCenter []string | |||||
}{} | }{} | ||||
var IPInfo = struct { | var IPInfo = struct { | ||||
@@ -16,6 +19,11 @@ func NewScreenMapConfig() { | |||||
ScreenMap.ShowData = sec.Key("ShowData").MustBool(false) | ScreenMap.ShowData = sec.Key("ShowData").MustBool(false) | ||||
ScreenMap.MinValue = sec.Key("MinValue").MustInt(130) | ScreenMap.MinValue = sec.Key("MinValue").MustInt(130) | ||||
ScreenMap.MaxValue = sec.Key("MaxValue").MustInt(190) | ScreenMap.MaxValue = sec.Key("MaxValue").MustInt(190) | ||||
ScreenMap.ExcludeCenter = []string{} | |||||
excludeCenterStr := sec.Key("ExcludeCenter").MustString("") | |||||
if excludeCenterStr != "" { | |||||
ScreenMap.ExcludeCenter = strings.Split(excludeCenterStr, ",") | |||||
} | |||||
sec = Cfg.Section("IPInfo") | sec = Cfg.Section("IPInfo") | ||||
@@ -211,14 +211,21 @@ func GetCloubrainOverviewGroupByAiCenter(ctx *context.Context) { | |||||
if setting.ScreenMap.ShowData || ctx.IsUserSiteAdmin() { | if setting.ScreenMap.ShowData || ctx.IsUserSiteAdmin() { | ||||
var cloudbrainCardTimeAndCountFilterArray = make([]map[string]string, 0) | |||||
for _, cloudbrainCardTimeAndCountMap := range cloudbrainCardTimeAndCountArray { | for _, cloudbrainCardTimeAndCountMap := range cloudbrainCardTimeAndCountArray { | ||||
centerId := cloudbrainCardTimeAndCountMap["ai_center"] | centerId := cloudbrainCardTimeAndCountMap["ai_center"] | ||||
centerShow := cloudbrainService.GetAiCenterShowByAiCenterId(centerId, ctx) | centerShow := cloudbrainService.GetAiCenterShowByAiCenterId(centerId, ctx) | ||||
cloudbrainCardTimeAndCountMap["ai_center"] = centerShow | cloudbrainCardTimeAndCountMap["ai_center"] = centerShow | ||||
if len(setting.ScreenMap.ExcludeCenter) > 0 && isExcludeCenter(centerId) { | |||||
continue | |||||
} | |||||
cloudbrainCardTimeAndCountFilterArray = append(cloudbrainCardTimeAndCountFilterArray, cloudbrainCardTimeAndCountMap) | |||||
} | } | ||||
ctx.JSON(http.StatusOK, map[string]interface{}{ | ctx.JSON(http.StatusOK, map[string]interface{}{ | ||||
"cardAndJobCount": cloudbrainCardTimeAndCountArray, | |||||
"cardAndJobCount": cloudbrainCardTimeAndCountFilterArray, | |||||
"locationInfo": aiCenterLocationInfos, | "locationInfo": aiCenterLocationInfos, | ||||
}) | }) | ||||
return | return | ||||
@@ -232,6 +239,15 @@ func GetCloubrainOverviewGroupByAiCenter(ctx *context.Context) { | |||||
} | } | ||||
func isExcludeCenter(id string) bool { | |||||
for _, centerId := range setting.ScreenMap.ExcludeCenter { | |||||
if id == centerId { | |||||
return true | |||||
} | |||||
} | |||||
return false | |||||
} | |||||
func getAiCenterSize(name string, timeMap map[string]int64, MaxCardTime int64, MinCardTime int64) int { | func getAiCenterSize(name string, timeMap map[string]int64, MaxCardTime int64, MinCardTime int64) int { | ||||
cardTime, _ := timeMap[name] | cardTime, _ := timeMap[name] | ||||
if cardTime == 0 { | if cardTime == 0 { | ||||
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》