| @@ -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) | ||||