| @@ -366,7 +366,7 @@ | |||
| </div> | |||
| <div class="three wide column text center padding0"> | |||
| <div class="ui compact buttons"> | |||
| <!-- <div class="ui compact buttons"> | |||
| <form id="stopForm-{{.JobID}}" action="/api/v1/repos{{$.Link}}/{{.JobID}}/stop_version" method="post"> | |||
| <input type="hidden" name="version_name" value="{{.VersionName}}"> | |||
| {{$.CsrfTokenHtml}} | |||
| @@ -380,7 +380,7 @@ | |||
| </a> | |||
| {{end}} | |||
| </form> | |||
| </div> | |||
| </div> --> | |||
| <!-- 模型下载 --> | |||
| <!-- <div class="ui compact buttons"> | |||
| <a style="padding: 0.5rem;" class="ui basic blue button" href="{{$.Link}}/{{.JobID}}/models" target="_blank"> | |||
| @@ -388,6 +388,19 @@ | |||
| </a> | |||
| </div> --> | |||
| <!-- 删除任务 --> | |||
| <div class="ui compact buttons"> | |||
| {{$.CsrfTokenHtml}} | |||
| {{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}})"> | |||
| {{$.i18n.Tr "repo.stop"}} | |||
| </a> | |||
| {{else}} | |||
| <a style="padding: 0.5rem 1rem;" id="{{.VersionName}}-stop" class="ui basic disabled button"> | |||
| {{$.i18n.Tr "repo.stop"}} | |||
| </a> | |||
| {{end}} | |||
| </div> | |||
| <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> | |||
| {{$.CsrfTokenHtml}} | |||
| {{if $.Permission.CanWrite $.UnitTypeCloudBrain}} | |||
| @@ -590,7 +603,17 @@ | |||
| modal.style.display = "none"; | |||
| } | |||
| } | |||
| function stopVersion(version_name){ | |||
| $.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/stop_version`,{version_name:version_name},(data)=>{ | |||
| if(data.StatusOK===0){ | |||
| $('#'+version_name+'-stop').addClass('disabled') | |||
| refreshStatus(version_name) | |||
| } | |||
| }).fail(function(err) { | |||
| console.log(err); | |||
| }); | |||
| } | |||
| // 显示弹窗,弹出相应的信息 | |||
| function showmask() { | |||
| $('#imageModal').css('display', 'none') | |||