@@ -698,7 +698,7 @@ func GetCloudbrainByName(jobName string) (*Cloudbrain, error) { | |||||
} | } | ||||
func CanDelJob(isSigned bool, user *User, job *CloudbrainInfo) bool { | func CanDelJob(isSigned bool, user *User, job *CloudbrainInfo) bool { | ||||
if !isSigned || (job.Status != string(JobStopped) && job.Status != string(ModelArtsStartFailed) && job.Status != string(ModelArtsCreateFailed)){ | |||||
if !isSigned || (job.Status != string(JobStopped) && job.Status != string(JobFailed) && job.Status != string(ModelArtsStartFailed) && job.Status != string(ModelArtsCreateFailed)){ | |||||
return false | return false | ||||
} | } | ||||
repo, err := GetRepositoryByID(job.RepoID) | repo, err := GetRepositoryByID(job.RepoID) | ||||
@@ -337,9 +337,9 @@ | |||||
调试 | 调试 | ||||
</a> | </a> | ||||
<form id="stopForm-{{.JobID}}" action="{{if ((eq .Status "STOPPED") or (eq .Status "FAILED"))}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post" style="margin-left:-1px;"> | |||||
<form id="stopForm-{{.JobID}}" action="{{if or (eq .Status "STOPPED") (eq .Status "FAILED")}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post" style="margin-left:-1px;"> | |||||
{{$.CsrfTokenHtml}} | {{$.CsrfTokenHtml}} | ||||
<a class="ui basic {{if ((eq .Status "STOPPED") or (eq .Status "FAILED"))}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();"> | |||||
<a class="ui basic {{if or (eq .Status "STOPPED") (eq .Status "FAILED")}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();"> | |||||
停止 | 停止 | ||||
</a> | </a> | ||||
</form> | </form> | ||||