Browse Source

增加属性。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
e817fb00d0
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      routers/repo/aisafety.go

+ 13
- 0
routers/repo/aisafety.go View File

@@ -81,6 +81,7 @@ func GetAiSafetyTaskByJob(job *models.Cloudbrain) {

func GetAiSafetyTaskTmpl(ctx *context.Context) {
ctx.Data["id"] = ctx.Params(":jobid")
ctx.Data["PageIsCloudBrain"] = true
ctx.HTML(200, tplModelSafetyTestShow)
}

@@ -98,6 +99,18 @@ func GetAiSafetyTask(ctx *context.Context) {
job.CanModify = cloudbrain.CanModifyJob(ctx, job)
job.CanDel = cloudbrain.CanDeleteJob(ctx, job)

s, err := resource.GetCloudbrainSpec(job.ID)
if err == nil {
job.Spec = s
}
user, err := models.GetUserByID(job.UserID)
if err == nil {
tmpUser := &models.User{
Name: user.Name,
}
job.User = tmpUser
}

ctx.JSON(200, job)
}



Loading…
Cancel
Save