Browse Source

增加类型

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1427/head
zouap 3 years ago
parent
commit
c0907b3df5
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      routers/repo/cloudbrain.go

+ 6
- 1
routers/repo/cloudbrain.go View File

@@ -336,6 +336,11 @@ func CloudBrainRestart(ctx *context.Context) {
}

func CloudBrainBenchMarkShow(ctx *context.Context) {
if benchmarkTypes == nil {
if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil {
log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"])
}
}
cloudBrainShow(ctx, tplCloudBrainBenchmarkShow)
}

@@ -400,7 +405,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) {
} else {
duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix)
}
if benchmarkTypes.BenchmarkType != nil {
if benchmarkTypes != nil {
for _, benchmarkType := range benchmarkTypes.BenchmarkType {
if task.BenchmarkTypeID == benchmarkType.Id {
ctx.Data["BenchmarkTypeName"] = benchmarkType.First


Loading…
Cancel
Save