Browse Source

fix issue

pull/950/head
zhoupzh 3 years ago
parent
commit
c24df8fc36
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      templates/repo/modelarts/trainjob/index.tmpl

+ 3
- 3
templates/repo/modelarts/trainjob/index.tmpl View File

@@ -391,7 +391,7 @@
<div class="ui compact buttons"> <div class="ui compact buttons">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}} {{if $.Permission.CanWrite $.UnitTypeCloudBrain}}
<a style="padding: 0.5rem 1rem;" id="{{.VersionName}}-stop" class="ui basic {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED"}}disabled {{else}}blue {{end}}button" onclick="stopVersion({{.VersionName}})">
<a style="padding: 0.5rem 1rem;" id="{{.VersionName}}-stop" class="ui basic {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED"}}disabled {{else}}blue {{end}}button" onclick="stopVersion({{.VersionName}},{{.JobID}})">
{{$.i18n.Tr "repo.stop"}} {{$.i18n.Tr "repo.stop"}}
</a> </a>
{{else}} {{else}}
@@ -603,9 +603,9 @@
modal.style.display = "none"; modal.style.display = "none";
} }
} }
function stopVersion(version_name){
function stopVersion(version_name,jobID){
$.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/stop_version`,{version_name:version_name},(data)=>{
$.post(`/api/v1/repos{{$.Link}}/${.JobID}/stop_version`,{version_name:version_name},(data)=>{
if(data.StatusOK===0){ if(data.StatusOK===0){
$('#'+version_name+'-stop').addClass('disabled') $('#'+version_name+'-stop').addClass('disabled')
refreshStatus(version_name) refreshStatus(version_name)


Loading…
Cancel
Save