Browse Source

删除无用代码

tags/v1.21.12.1^2
liuzx 4 years ago
parent
commit
4d36cb8175
2 changed files with 4 additions and 29 deletions
  1. +2
    -14
      routers/repo/cloudbrain.go
  2. +2
    -15
      routers/repo/modelarts.go

+ 2
- 14
routers/repo/cloudbrain.go View File

@@ -244,7 +244,6 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {
ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form)
return
}
// ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain")
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
}

@@ -352,7 +351,6 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain

func CloudBrainStop(ctx *context.Context) {
var jobID = ctx.Params(":jobid")
debugListType := ctx.Query("debugListType")
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
ctx.ServerError("GetCloudbrainByJobID failed", err)
@@ -378,12 +376,7 @@ func CloudBrainStop(ctx *context.Context) {
ctx.ServerError("UpdateJob failed", err)
return
}
if debugListType == modelarts.AllResource {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
} else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain")
}

ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
}

func StopJobsByUserID(userID int64) {
@@ -468,7 +461,6 @@ func logErrorAndUpdateJobStatus(err error, taskInfo *models.Cloudbrain) {

func CloudBrainDel(ctx *context.Context) {
var jobID = ctx.Params(":jobid")
debugListType := ctx.Query("debugListType")
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
ctx.ServerError("GetCloudbrainByJobID failed", err)
@@ -486,11 +478,7 @@ func CloudBrainDel(ctx *context.Context) {
ctx.ServerError("DeleteJob failed", err)
return
}
if debugListType == modelarts.AllResource {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
} else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain")
}
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
}

func CloudBrainShowModels(ctx *context.Context) {


+ 2
- 15
routers/repo/modelarts.go View File

@@ -155,8 +155,6 @@ func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsNotebookForm)
ctx.RenderWithErr(err.Error(), tplModelArtsNotebookNew, &form)
return
}

// ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/notebook")
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
}

@@ -235,7 +233,6 @@ func NotebookDebug(ctx *context.Context) {

func NotebookStop(ctx *context.Context) {
var jobID = ctx.Params(":jobid")
debugListType := ctx.Query("debugListType")
log.Info(jobID)
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
@@ -265,17 +262,11 @@ func NotebookStop(ctx *context.Context) {
ctx.ServerError("UpdateJob failed", err)
return
}

if debugListType == modelarts.AllResource {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
} else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/notebook")
}
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
}

func NotebookDel(ctx *context.Context) {
var jobID = ctx.Params(":jobid")
debugListType := ctx.Query("debugListType")
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {
ctx.ServerError("GetCloudbrainByJobID failed", err)
@@ -301,11 +292,7 @@ func NotebookDel(ctx *context.Context) {
return
}

if debugListType == modelarts.AllResource {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
} else {
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/notebook")
}
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob")
}

func TrainJobIndex(ctx *context.Context) {


Loading…
Cancel
Save