| @@ -81,6 +81,7 @@ func GetAiSafetyTaskByJob(job *models.Cloudbrain) { | |||||
| func GetAiSafetyTaskTmpl(ctx *context.Context) { | func GetAiSafetyTaskTmpl(ctx *context.Context) { | ||||
| ctx.Data["id"] = ctx.Params(":jobid") | ctx.Data["id"] = ctx.Params(":jobid") | ||||
| ctx.Data["PageIsCloudBrain"] = true | |||||
| ctx.HTML(200, tplModelSafetyTestShow) | ctx.HTML(200, tplModelSafetyTestShow) | ||||
| } | } | ||||
| @@ -98,6 +99,18 @@ func GetAiSafetyTask(ctx *context.Context) { | |||||
| job.CanModify = cloudbrain.CanModifyJob(ctx, job) | job.CanModify = cloudbrain.CanModifyJob(ctx, job) | ||||
| job.CanDel = cloudbrain.CanDeleteJob(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) | ctx.JSON(200, job) | ||||
| } | } | ||||