|
|
@@ -6,7 +6,7 @@ |
|
|
|
color: #252b3a; |
|
|
|
background-color: #f2f5fc; |
|
|
|
line-height: 1.5; |
|
|
|
cursor: pointer; |
|
|
|
cursor: default; |
|
|
|
-moz-user-select: none; |
|
|
|
-webkit-user-select: none; |
|
|
|
-ms-user-select: none; |
|
|
@@ -139,6 +139,13 @@ td, th { |
|
|
|
.text-width80{ |
|
|
|
width: 100px; |
|
|
|
line-height: 30px; |
|
|
|
|
|
|
|
} |
|
|
|
.disabled { |
|
|
|
cursor: not-allowed; |
|
|
|
pointer-events: none; |
|
|
|
color: #BBBBBB !important; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
<div class="repository"> |
|
|
@@ -148,17 +155,17 @@ td, th { |
|
|
|
<a href="javascript:window.history.back();"><i class="arrow left icon"></i>返回</a> |
|
|
|
</h4> |
|
|
|
{{range $k ,$v := .version_list_task}} |
|
|
|
<div class="ui accordion"> |
|
|
|
<div class="ui accordion" id="accordion{{.VersionName}}"> |
|
|
|
<div class="title padding0"> |
|
|
|
<div class="according-panel-heading"> |
|
|
|
<div class="accordion-panel-title"> |
|
|
|
<i class="dropdown icon"></i> |
|
|
|
<i class="dropdown icon" style="cursor: pointer;"></i> |
|
|
|
<span class="accordion-panel-title-content"> |
|
|
|
<span> |
|
|
|
<div style="float: right;"> |
|
|
|
<a class="ti-action-menu-item">创建模型</a> |
|
|
|
<a class="ti-action-menu-item {{if ne .Status "COMPLETED"}}disabled {{end}}">创建模型</a> |
|
|
|
<a class="ti-action-menu-item" href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/create_version?version_name={{.VersionName}}">修改</a> |
|
|
|
<a class="ti-action-menu-item" onclick="stopVersion({{.VersionName}})">停止</a> |
|
|
|
<a class="ti-action-menu-item {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED"}}disabled {{end}}" id="{{.VersionName}}-stop" onclick="stopVersion({{.VersionName}})">停止</a> |
|
|
|
<a class="ti-action-menu-item" onclick="deleteVersion({{.VersionName}})" style="color: #FF4D4F;">删除</a> |
|
|
|
</div> |
|
|
|
<div class="ac-display-inblock title_text acc-margin-bottom"> |
|
|
@@ -171,7 +178,7 @@ td, th { |
|
|
|
</span> |
|
|
|
<span class="ac-text-normal title_text">运行时间:</span> |
|
|
|
<span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{.TrainJobDuration}}</span> |
|
|
|
<span data-tooltip="刷新" data-inverted="" onclick="refreshStatus({{.VersionName}})"><i class="redo icon redo-color"></i></span> |
|
|
|
<span style="cursor: pointer;" data-tooltip="刷新" data-inverted="" onclick="refreshStatus({{.VersionName}})"><i class="redo icon redo-color"></i></span> |
|
|
|
|
|
|
|
</div> |
|
|
|
</span> |
|
|
@@ -397,6 +404,26 @@ td, th { |
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
</div> |
|
|
|
<!-- 确认模态框 --> |
|
|
|
<div id="deletemodel"> |
|
|
|
<div class="ui basic modal"> |
|
|
|
<div class="ui icon header"> |
|
|
|
<i class="trash icon"></i> 删除任务 |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="content"> |
|
|
|
<p>你确认删除该任务么?此任务一旦删除不可恢复。</p> |
|
|
|
</div> |
|
|
|
<div class="actions"> |
|
|
|
<div class="ui red basic inverted cancel button"> |
|
|
|
<i class="remove icon"></i> 取消操作 |
|
|
|
</div> |
|
|
|
<div class="ui green basic inverted ok button"> |
|
|
|
<i class="checkmark icon"></i> 确定操作 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{{template "base/footer" .}} |
|
|
|
|
|
|
@@ -406,9 +433,9 @@ td, th { |
|
|
|
$('.menu .item').tab() |
|
|
|
// $('.ui.style.accordion').accordion(); |
|
|
|
|
|
|
|
// $(document).ready(function(){ |
|
|
|
// $('.ui.accordion').accordion({selector:{trigger:'.icon'}}); |
|
|
|
// }); |
|
|
|
$(document).ready(function(){ |
|
|
|
$('.ui.accordion').accordion({selector:{trigger:'.icon'}}); |
|
|
|
}); |
|
|
|
$(document).ready(function(){ |
|
|
|
$('.secondary.menu .item').tab(); |
|
|
|
}); |
|
|
@@ -450,16 +477,41 @@ td, th { |
|
|
|
stopBubbling(arguments.callee.caller.arguments[0]) |
|
|
|
} |
|
|
|
function deleteVersion(version_name){ |
|
|
|
$.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/del_version`,{version_name:version_name}).fail(function(err) { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
let flag = 1; |
|
|
|
$('.ui.basic.modal') |
|
|
|
.modal({ |
|
|
|
onDeny: function() { |
|
|
|
flag = false |
|
|
|
}, |
|
|
|
onApprove: function() { |
|
|
|
$.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/del_version`,{version_name:version_name},(data)=>{ |
|
|
|
$('#accordion'+version_name).remove() |
|
|
|
}).fail(function(err) { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
flag = true |
|
|
|
}, |
|
|
|
onHidden: function() { |
|
|
|
if (flag == false) { |
|
|
|
$('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut(); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
.modal('show') |
|
|
|
|
|
|
|
stopBubbling(arguments.callee.caller.arguments[0]) |
|
|
|
} |
|
|
|
function stopVersion(version_name){ |
|
|
|
$.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/stop_version`,{version_name:version_name}).fail(function(err) { |
|
|
|
stopBubbling(arguments.callee.caller.arguments[0]) |
|
|
|
$.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); |
|
|
|
}); |
|
|
|
stopBubbling(arguments.callee.caller.arguments[0]) |
|
|
|
|
|
|
|
} |
|
|
|
function loadLog(version_name){ |
|
|
|
$.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&lines=20&order=asc`, (data) => { |
|
|
|