|
|
@@ -834,6 +834,11 @@ func Cloudbrains(ctx *context.Context) { |
|
|
|
ciTasks[i].CanDebug = true |
|
|
|
ciTasks[i].CanDel = true |
|
|
|
ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource |
|
|
|
ciTasks[i].Cloudbrain.AiCenter = GetCloudbrainAiCenter(task.Cloudbrain, ctx) |
|
|
|
_, cardType, _ := models.GetCloudbrainCardNumAndType(task.Cloudbrain) |
|
|
|
ciTasks[i].Cloudbrain.CardType = cardType |
|
|
|
ciTasks[i].Cloudbrain.Cluster = GetCloudbrainCluster(task.Cloudbrain, ctx) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, getTotalPage(count, setting.UI.IssuePagingNum)) |
|
|
@@ -857,3 +862,22 @@ func getTotalPage(total int64, pageSize int) int { |
|
|
|
return int(total)/pageSize + another |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func GetCloudbrainAiCenter(task models.Cloudbrain, ctx *context.Context) string { |
|
|
|
if task.Type == models.TypeCloudBrainOne { |
|
|
|
return ctx.Tr("repo.cloudbrain1") |
|
|
|
} else if task.Type == models.TypeCloudBrainTwo { |
|
|
|
return ctx.Tr("repo.cloudbrain2") |
|
|
|
} else if task.Type == models.TypeC2Net { |
|
|
|
return task.AiCenter |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
func GetCloudbrainCluster(task models.Cloudbrain, ctx *context.Context) string { |
|
|
|
if task.Type == models.TypeCloudBrainOne || task.Type == models.TypeCloudBrainTwo { |
|
|
|
return ctx.Tr("cloudbrain.resource_cluster_openi") |
|
|
|
} else if task.Type == models.TypeC2Net { |
|
|
|
return ctx.Tr("cloudbrain.resource_cluster_c2net") |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |