diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 166fe6704..86287e0b6 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -357,14 +357,14 @@ func NotebookShow(ctx *context.Context) { task, err := models.GetCloudbrainByJobID(jobID) if err != nil { ctx.Data["error"] = err.Error() - ctx.RenderWithErr(err.Error(), tplModelArtsNotebookIndex, nil) + ctx.RenderWithErr(err.Error(), tplModelArtsNotebookShow, nil) return } result, err := modelarts.GetJob(jobID) if err != nil { ctx.Data["error"] = err.Error() - ctx.RenderWithErr(err.Error(), tplModelArtsNotebookIndex, nil) + ctx.RenderWithErr(err.Error(), tplModelArtsNotebookShow, nil) return } @@ -373,7 +373,7 @@ func NotebookShow(ctx *context.Context) { err = models.UpdateJob(task) if err != nil { ctx.Data["error"] = err.Error() - ctx.RenderWithErr(err.Error(), tplModelArtsNotebookIndex, nil) + ctx.RenderWithErr(err.Error(), tplModelArtsNotebookShow, nil) return } @@ -614,17 +614,17 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) logObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.LogPath dataPath := "/" + setting.Bucket + "/" + setting.BasePath + path.Join(uuid[0:1], uuid[1:2]) + "/" + uuid + "/" - can, err := canUserCreateTrainJob(ctx.User.ID) - if err != nil { - ctx.ServerError("canUserCreateTrainJob", err) - return - } - - if !can { - log.Error("the user can not create train-job") - ctx.RenderWithErr("the user can not create train-job", tplModelArtsTrainJobNew, &form) - return - } + //can, err := canUserCreateTrainJob(ctx.User.ID) + //if err != nil { + // ctx.ServerError("canUserCreateTrainJob", err) + // return + //} + // + //if !can { + // log.Error("the user can not create train-job") + // ctx.RenderWithErr("the user can not create train-job", tplModelArtsTrainJobNew, &form) + // return + //} //param check if err := paramCheckCreateTrainJob(form); err != nil { @@ -735,7 +735,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) Parameters: param, } - err = modelarts.GenerateTrainJob(ctx, req) + err := modelarts.GenerateTrainJob(ctx, req) if err != nil { log.Error("GenerateTrainJob failed:%v", err.Error()) ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobNew, &form) @@ -838,21 +838,21 @@ func TrainJobShow(ctx *context.Context) { task, err := models.GetCloudbrainByJobID(jobID) if err != nil { log.Error("GetCloudbrainByJobID(%s) failed:%v", jobID, err.Error()) - ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobIndex, nil) + ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobShow, nil) return } attach, err := models.GetAttachmentByUUID(task.Uuid) if err != nil { log.Error("GetAttachmentByUUID(%s) failed:%v", jobID, err.Error()) - ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobIndex, nil) + ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobShow, nil) return } result, err := modelarts.GetTrainJob(jobID, strconv.FormatInt(task.VersionID, 10)) if err != nil { log.Error("GetJob(%s) failed:%v", jobID, err.Error()) - ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobIndex, nil) + ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobShow, nil) return } diff --git a/templates/repo/modelarts/notebook/index.tmpl b/templates/repo/modelarts/notebook/index.tmpl index d1beed6c2..01e2b6545 100755 --- a/templates/repo/modelarts/notebook/index.tmpl +++ b/templates/repo/modelarts/notebook/index.tmpl @@ -200,6 +200,7 @@ {{template "repo/header" .}}
+ {{template "base/alert" .}} diff --git a/templates/repo/modelarts/trainjob/index.tmpl b/templates/repo/modelarts/trainjob/index.tmpl index 8a74c3f16..4e39920b8 100755 --- a/templates/repo/modelarts/trainjob/index.tmpl +++ b/templates/repo/modelarts/trainjob/index.tmpl @@ -200,6 +200,7 @@ {{template "repo/header" .}}
+ {{template "base/alert" .}}