|
|
|
@@ -155,7 +155,6 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { |
|
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
|
jobName := form.JobName |
|
|
|
image := form.Image |
|
|
|
command := form.Command |
|
|
|
uuid := form.Attachment |
|
|
|
jobType := form.JobType |
|
|
|
gpuQueue := form.GpuType |
|
|
|
@@ -174,7 +173,14 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
count, err := models.GetCloudbrainCountByUserID(ctx.User.ID) |
|
|
|
var command string |
|
|
|
if jobType == string(models.JobTypeBenchmark) { |
|
|
|
command = cloudbrain.CommandBenchmark |
|
|
|
} else { |
|
|
|
command = cloudbrain.Command |
|
|
|
} |
|
|
|
|
|
|
|
count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, jobType) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) |
|
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
|
@@ -244,7 +250,12 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { |
|
|
|
ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") |
|
|
|
|
|
|
|
if jobType == string(models.JobTypeBenchmark) { |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") |
|
|
|
} else { |
|
|
|
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func CloudBrainRestart(ctx *context.Context) { |
|
|
|
@@ -276,7 +287,7 @@ func CloudBrainRestart(ctx *context.Context) { |
|
|
|
break |
|
|
|
} |
|
|
|
|
|
|
|
count, err := models.GetCloudbrainCountByUserID(ctx.User.ID) |
|
|
|
count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, string(models.JobTypeDebug)) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) |
|
|
|
resultCode = "-1" |
|
|
|
|