diff --git a/modules/auth/cloudbrain.go b/modules/auth/cloudbrain.go index e7268052d..462e4211f 100755 --- a/modules/auth/cloudbrain.go +++ b/modules/auth/cloudbrain.go @@ -11,7 +11,7 @@ type CreateCloudBrainForm struct { Command string `form:"command" binding:"Required"` Attachment string `form:"attachment" binding:"Required"` JobType string `form:"job_type" binding:"Required"` - BenchmarkCategory string `form:"benchmark_category"` + BenchmarkCategory string `form:"get_benchmark_category"` } type CommitImageCloudBrainForm struct { diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 9c9ec8e74..952177d61 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -178,7 +178,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) return } - ctx.HTML(200, tplCloudBrainIndex) + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") } func CloudBrainShow(ctx *context.Context) { @@ -261,16 +261,15 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain func CloudBrainStop(ctx *context.Context) { var jobID = ctx.Params(":jobid") - log.Info(jobID) task, err := models.GetCloudbrainByJobID(jobID) if err != nil { ctx.ServerError("GetCloudbrainByJobID failed", err) return } - if task.Status != string(models.JobRunning) { - log.Error("the job(%s) is not running", task.JobName) - ctx.ServerError("the job is not running", errors.New("the job is not running")) + if task.Status == string(models.JobStopped) { + log.Error("the job(%s) has been stopped", task.JobName) + ctx.ServerError("the job has been stopped", errors.New("the job has been stopped")) return } diff --git a/templates/repo/cloudbrain/index.tmpl b/templates/repo/cloudbrain/index.tmpl index 0dc0aa090..9a58a05a6 100755 --- a/templates/repo/cloudbrain/index.tmpl +++ b/templates/repo/cloudbrain/index.tmpl @@ -297,9 +297,9 @@