Browse Source

处理任务对应的仓库信息可能为空的问题

tags/v1.22.2.2^2
ychao_1983 3 years ago
parent
commit
05740cface
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      routers/admin/cloudbrains.go

+ 8
- 1
routers/admin/cloudbrains.go View File

@@ -179,10 +179,17 @@ func DownloadCloudBrains(ctx *context.Context) {

func allValues(row int, rs *models.CloudbrainInfo, ctx *context.Context) map[string]string {
return map[string]string{getCellName("A", row): rs.JobName, getCellName("B", row): rs.Status, getCellName("C", row): rs.JobType, getCellName("D", row): time.Unix(int64(rs.Cloudbrain.CreatedUnix), 0).Format(CREATE_TIME_FORMAT), getCellName("E", row): getDurationTime(rs),
getCellName("F", row): rs.ComputeResource, getCellName("G", row): rs.Name, getCellName("H", row): rs.Repo.OwnerName + "/" + rs.Repo.Alias, getCellName("I", row): rs.JobName,
getCellName("F", row): rs.ComputeResource, getCellName("G", row): rs.Name, getCellName("H", row): getRepoPathName(rs), getCellName("I", row): rs.JobName,
}
}

func getRepoPathName(rs *models.CloudbrainInfo) string {
if rs.Repo != nil {
return rs.Repo.OwnerName + "/" + rs.Repo.Alias
}
return ""
}

func getDurationTime(rs *models.CloudbrainInfo) string {
if rs.JobType == "TRAIN" || rs.JobType == "INFERENCE" {
return rs.TrainJobDuration


Loading…
Cancel
Save