|
|
|
@@ -799,7 +799,7 @@ func GetCloudbrainsDetailData(ctx *context.Context) { |
|
|
|
taskDetail.Type = ciTasks[i].Cloudbrain.Type |
|
|
|
taskDetail.UserName = ciTasks[i].User.Name |
|
|
|
taskDetail.RepoID = ciTasks[i].RepoID |
|
|
|
taskDetail.AiCenter = repo.GetAiCenterNameByCode(task.Cloudbrain.AiCenter) |
|
|
|
taskDetail.AiCenter = repo.GetAiCenterNameByCode(task.Cloudbrain.AiCenter, ctx.Language()) |
|
|
|
if ciTasks[i].Repo != nil { |
|
|
|
taskDetail.RepoName = ciTasks[i].Repo.OwnerName + "/" + ciTasks[i].Repo.Name |
|
|
|
taskDetail.RepoAlias = ciTasks[i].Repo.OwnerName + "/" + ciTasks[i].Repo.Alias |
|
|
|
@@ -1249,7 +1249,7 @@ func DownloadCloudBrainBoard(ctx *context.Context) { |
|
|
|
models.LoadSpecs4CloudbrainInfo(pageRecords) |
|
|
|
for _, record := range pageRecords { |
|
|
|
record = cloudbrainService.UpdateCloudbrainAiCenter(record) |
|
|
|
record.Cloudbrain.AiCenter = repo.GetAiCenterNameByCode(record.Cloudbrain.AiCenter) |
|
|
|
record.Cloudbrain.AiCenter = repo.GetAiCenterNameByCode(record.Cloudbrain.AiCenter, ctx.Language()) |
|
|
|
for k, v := range allCloudbrainValues(row, record, ctx) { |
|
|
|
f.SetCellValue(cloudBrain, k, v) |
|
|
|
} |
|
|
|
@@ -1452,7 +1452,7 @@ func GetCloudbrainResourceOverview(ctx *context.Context) { |
|
|
|
C2NetResourceDetail := []models.ResourceDetail{} |
|
|
|
for _, resourceQueue := range resourceQueues { |
|
|
|
if resourceQueue.Cluster == models.OpenICluster { |
|
|
|
aiCenterName := repo.GetAiCenterNameByCode(resourceQueue.AiCenterCode) |
|
|
|
aiCenterName := repo.GetAiCenterNameByCode(resourceQueue.AiCenterCode, ctx.Language()) |
|
|
|
var resourceDetail models.ResourceDetail |
|
|
|
resourceDetail.QueueCode = resourceQueue.QueueCode |
|
|
|
resourceDetail.Cluster = resourceQueue.Cluster |
|
|
|
@@ -1465,7 +1465,7 @@ func GetCloudbrainResourceOverview(ctx *context.Context) { |
|
|
|
OpenIResourceDetail = append(OpenIResourceDetail, resourceDetail) |
|
|
|
} |
|
|
|
if resourceQueue.Cluster == models.C2NetCluster { |
|
|
|
aiCenterName := repo.GetAiCenterNameByCode(resourceQueue.AiCenterCode) |
|
|
|
aiCenterName := repo.GetAiCenterNameByCode(resourceQueue.AiCenterCode, ctx.Language()) |
|
|
|
var resourceDetail models.ResourceDetail |
|
|
|
resourceDetail.QueueCode = resourceQueue.QueueCode |
|
|
|
resourceDetail.Cluster = resourceQueue.Cluster |
|
|
|
@@ -1685,7 +1685,7 @@ func getDurationStatistic(beginTime time.Time, endTime time.Time) (models.Durati |
|
|
|
return OpenIDurationRate, C2NetDurationRate, 0 |
|
|
|
} |
|
|
|
for _, cloudbrainStatistic := range cardDurationStatistics { |
|
|
|
aiCenterName := cloudbrainStatistic.AiCenterCode + "/" + repo.GetAiCenterNameByCode(cloudbrainStatistic.AiCenterCode) |
|
|
|
aiCenterName := cloudbrainStatistic.AiCenterCode + "/" + repo.GetAiCenterNameByCode(cloudbrainStatistic.AiCenterCode, "zh-CN") |
|
|
|
if cloudbrainStatistic.Cluster == models.OpenICluster { |
|
|
|
if _, ok := OpenITotalDuration[aiCenterName]; !ok { |
|
|
|
OpenITotalDuration[aiCenterName] = cloudbrainStatistic.CardsTotalDuration |
|
|
|
@@ -1717,7 +1717,7 @@ func getDurationStatistic(beginTime time.Time, endTime time.Time) (models.Durati |
|
|
|
return OpenIDurationRate, C2NetDurationRate, 0 |
|
|
|
} |
|
|
|
for _, v := range ResourceAiCenterRes { |
|
|
|
aiCenterName := v.AiCenterCode + "/" + repo.GetAiCenterNameByCode(v.AiCenterCode) |
|
|
|
aiCenterName := v.AiCenterCode + "/" + repo.GetAiCenterNameByCode(v.AiCenterCode, "zh-CN") |
|
|
|
if cutString(v.AiCenterCode, 4) == cutString(models.AICenterOfCloudBrainOne, 4) { |
|
|
|
if _, ok := OpenIUsageDuration[aiCenterName]; !ok { |
|
|
|
OpenIUsageDuration[aiCenterName] = 0 |
|
|
|
@@ -1877,7 +1877,7 @@ func GetResourceQueues(ctx *context.Context) { |
|
|
|
aiCenterCodeMap := make(map[string]string) |
|
|
|
for _, resourceQueue := range resourceQueues { |
|
|
|
if _, ok := aiCenterCodeMap[resourceQueue.AiCenterCode]; !ok { |
|
|
|
resourceQueue.AiCenterName = repo.GetAiCenterNameByCode(resourceQueue.AiCenterCode) |
|
|
|
resourceQueue.AiCenterName = repo.GetAiCenterNameByCode(resourceQueue.AiCenterCode, ctx.Language()) |
|
|
|
aiCenterCodeMap[resourceQueue.AiCenterCode] = resourceQueue.AiCenterCode |
|
|
|
Resource = append(Resource, resourceQueue) |
|
|
|
} |
|
|
|
|