Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1513 Reviewed-by: ychao_1983 <ychao_1983@sina.com>pull/1517/head
@@ -582,12 +582,13 @@ func logErrorAndUpdateJobStatus(err error, taskInfo *models.Cloudbrain) { | |||||
} | } | ||||
func CloudBrainDel(ctx *context.Context) { | func CloudBrainDel(ctx *context.Context) { | ||||
var listType = ctx.Query("debugListType") | |||||
if err := deleteCloudbrainJob(ctx); err != nil { | if err := deleteCloudbrainJob(ctx); err != nil { | ||||
log.Error("deleteCloudbrainJob failed: %v", err, ctx.Data["msgID"]) | log.Error("deleteCloudbrainJob failed: %v", err, ctx.Data["msgID"]) | ||||
ctx.ServerError(err.Error(), err) | ctx.ServerError(err.Error(), err) | ||||
return | 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 { | func deleteCloudbrainJob(ctx *context.Context) error { | ||||
@@ -418,6 +418,7 @@ func NotebookManage(ctx *context.Context) { | |||||
func NotebookDel(ctx *context.Context) { | func NotebookDel(ctx *context.Context) { | ||||
var jobID = ctx.Params(":jobid") | var jobID = ctx.Params(":jobid") | ||||
var listType = ctx.Query("debugListType") | |||||
task := ctx.Cloudbrain | task := ctx.Cloudbrain | ||||
if task.Status != string(models.ModelArtsCreateFailed) && task.Status != string(models.ModelArtsStartFailed) && task.Status != string(models.ModelArtsStopped) { | 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 | 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) { | func TrainJobIndex(ctx *context.Context) { | ||||
@@ -366,7 +366,7 @@ | |||||
</form> | </form> | ||||
<!-- 删除 --> | <!-- 删除 --> | ||||
<form id="delForm-{{.JobID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/del" method="post"> | <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}} | {{$.CsrfTokenHtml}} | ||||
{{if .CanDel}} | {{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;"> | <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;"> | ||||