|
|
@@ -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 |
|
|
|
} |
|
|
|
|
|
|
|