diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 29ef3fe6c..389f86b24 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -187,7 +187,10 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain var jobID = ctx.Params(":jobid") task, err := models.GetCloudbrainByJobID(jobID) if err != nil { - ctx.ServerError("GetCloudbrainByJobID failed", err) + ctx.JSON(200, map[string]string{ + "result_code": "-1", + "error_msg": "GetCloudbrainByJobID failed", + }) return } @@ -199,11 +202,17 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain }) if err != nil { log.Error("CommitImage(%s) failed:", task.JobName, err.Error()) - ctx.ServerError("CommitImage failed", err) + ctx.JSON(200, map[string]string{ + "result_code": "-1", + "error_msg": "CommitImage failed", + }) return } - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") + ctx.JSON(200, map[string]string{ + "result_code": "0", + "error_msg": "", + }) } func CloudBrainStop(ctx *context.Context) { diff --git a/templates/repo/cloudbrain/index.tmpl b/templates/repo/cloudbrain/index.tmpl index 6a4ba1f50..5361db7dd 100755 --- a/templates/repo/cloudbrain/index.tmpl +++ b/templates/repo/cloudbrain/index.tmpl @@ -1,215 +1,357 @@ {{template "base/head" .}} + +