|
|
@@ -404,10 +404,11 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { |
|
|
} else { |
|
|
} else { |
|
|
duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) |
|
|
duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) |
|
|
} |
|
|
} |
|
|
if benchmarkTypes != nil { |
|
|
|
|
|
|
|
|
if task.BenchmarkTypeID > 0 { |
|
|
for _, benchmarkType := range benchmarkTypes.BenchmarkType { |
|
|
for _, benchmarkType := range benchmarkTypes.BenchmarkType { |
|
|
if task.BenchmarkTypeID == benchmarkType.Id { |
|
|
if task.BenchmarkTypeID == benchmarkType.Id { |
|
|
ctx.Data["BenchmarkTypeName"] = benchmarkType.First |
|
|
ctx.Data["BenchmarkTypeName"] = benchmarkType.First |
|
|
|
|
|
ctx.Data["RankLink"] = benchmarkType.RankLink |
|
|
for _, benchmarkChildType := range benchmarkType.Second { |
|
|
for _, benchmarkChildType := range benchmarkType.Second { |
|
|
if task.BenchmarkChildTypeID == benchmarkChildType.Id { |
|
|
if task.BenchmarkChildTypeID == benchmarkChildType.Id { |
|
|
ctx.Data["BenchmarkChildTypeName"] = benchmarkChildType.Value |
|
|
ctx.Data["BenchmarkChildTypeName"] = benchmarkChildType.Value |
|
|
@@ -1051,6 +1052,13 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if benchmarkTypes == nil { |
|
|
|
|
|
if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { |
|
|
|
|
|
ctx.ServerError("Get BenchmarkTypes faild:", err) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for i, task := range ciTasks { |
|
|
for i, task := range ciTasks { |
|
|
ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) |
|
|
ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) |
|
|
ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource |
|
|
ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource |
|
|
@@ -1061,6 +1069,16 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { |
|
|
duration = int64(task.Cloudbrain.UpdatedUnix) - int64(task.Cloudbrain.CreatedUnix) |
|
|
duration = int64(task.Cloudbrain.UpdatedUnix) - int64(task.Cloudbrain.CreatedUnix) |
|
|
} |
|
|
} |
|
|
ciTasks[i].TrainJobDuration = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000) |
|
|
ciTasks[i].TrainJobDuration = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000) |
|
|
|
|
|
ciTasks[i].BenchmarkTypeName = "" |
|
|
|
|
|
if task.BenchmarkTypeID > 0 { |
|
|
|
|
|
for _, benchmarkType := range benchmarkTypes.BenchmarkType { |
|
|
|
|
|
if task.BenchmarkTypeID == benchmarkType.Id { |
|
|
|
|
|
ciTasks[i].BenchmarkTypeRankLink = benchmarkType.RankLink |
|
|
|
|
|
ciTasks[i].BenchmarkTypeName = benchmarkType.First |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) |
|
|
pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) |
|
|
|