Browse Source

去掉前端的规则

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.1.3
zouap 3 years ago
parent
commit
81ef4ff092
2 changed files with 38 additions and 2 deletions
  1. +16
    -1
      routers/repo/cloudbrain.go
  2. +22
    -1
      templates/repo/cloudbrain/benchmark/show.tmpl

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

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

ctx.Data["duration"] = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000)
ctx.Data["task"] = task
ctx.Data["jobID"] = jobID
@@ -445,7 +460,7 @@ func CloudBrainStop(ctx *context.Context) {

task := ctx.Cloudbrain
for {
if task.Status == string(models.JobStopped) || task.Status == string(models.JobFailed) || task.Status == string(models.JobSucceeded){
if task.Status == string(models.JobStopped) || task.Status == string(models.JobFailed) || task.Status == string(models.JobSucceeded) {
log.Error("the job(%s) has been stopped", task.JobName, ctx.Data["msgID"])
resultCode = "-1"
errorMsg = "system error"


+ 22
- 1
templates/repo/cloudbrain/benchmark/show.tmpl View File

@@ -277,7 +277,17 @@ td, th {
</div>
</td>
</tr>

<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
类型
</td>
<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-mirror">
{{$.BenchmarkTypeName}}
</div>
</td>
</tr>
</tbody>
@@ -346,6 +356,17 @@ td, th {
</div>
</td>
</tr>
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
子类型
</td>
<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-mirror">
{{$.BenchmarkChildTypeName}}
</div>
</td>
</tr>
</tbody>
</table>
</div>


Loading…
Cancel
Save