#1513 删除云脑任务后保持筛选条件

Merged
ychao_1983 merged 2 commits from fix-1509 into V20220228 2 years ago
  1. +2
    -1
      routers/repo/cloudbrain.go
  2. +2
    -1
      routers/repo/modelarts.go
  3. +1
    -1
      templates/repo/debugjob/index.tmpl

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

@@ -582,12 +582,13 @@ func logErrorAndUpdateJobStatus(err error, taskInfo *models.Cloudbrain) {
}

func CloudBrainDel(ctx *context.Context) {
var listType = ctx.Query("debugListType")
if err := deleteCloudbrainJob(ctx); err != nil {
log.Error("deleteCloudbrainJob failed: %v", err, ctx.Data["msgID"])
ctx.ServerError(err.Error(), err)
return
}
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all")
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=" + listType)
}

func deleteCloudbrainJob(ctx *context.Context) error {


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

@@ -418,6 +418,7 @@ func NotebookManage(ctx *context.Context) {

func NotebookDel(ctx *context.Context) {
var jobID = ctx.Params(":jobid")
var listType = ctx.Query("debugListType")
task := ctx.Cloudbrain

if task.Status != string(models.ModelArtsCreateFailed) && task.Status != string(models.ModelArtsStartFailed) && task.Status != string(models.ModelArtsStopped) {
@@ -443,7 +444,7 @@ func NotebookDel(ctx *context.Context) {
return
}

ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all")
ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=" + listType)
}

func TrainJobIndex(ctx *context.Context) {


+ 1
- 1
templates/repo/debugjob/index.tmpl View File

@@ -366,7 +366,7 @@
</form>
<!-- 删除 -->
<form id="delForm-{{.JobID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/del" method="post">
<input type="hidden" name="debugListType" value="all">
<input type="hidden" name="debugListType" value="{{$.ListType}}">
{{$.CsrfTokenHtml}}
{{if .CanDel}}
<a id="model-delete-{{.JobID}}" class='ui basic {{if eq .Status "STOPPED" "FAILED" "START_FAILED"}}blue {{else}}disabled {{end}}button' onclick="assertDelete(this)" style="border-radius: .28571429rem;">


Loading…
Cancel
Save