diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index 091ae022f..826c68a9b 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -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) }