|
|
@@ -236,7 +236,7 @@ |
|
|
|
</h4> |
|
|
|
{{range $k ,$v := .version_list_task}} |
|
|
|
<div class="ui accordion border-according" id="accordion{{.VersionName}}" |
|
|
|
data-repopath="{{$.RepoRelPath}}/modelarts/train-job" data-jobid="{{.JobID}}" |
|
|
|
data-repopath="{{$.RepoRelPath}}/grampus/train-job" data-jobid="{{.JobID}}" |
|
|
|
data-version="{{.VersionName}}"> |
|
|
|
<div class="{{if eq $k 0}}active{{end}} title padding0"> |
|
|
|
<div class="according-panel-heading"> |
|
|
@@ -270,9 +270,9 @@ |
|
|
|
class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span> |
|
|
|
<span class="cti-mgRight-sm uc-accordionTitle-black" |
|
|
|
id="{{.VersionName}}-duration-span">{{.TrainJobDuration}}</span> |
|
|
|
<span data-tooltip="刷新" style="cursor: pointer;" data-inverted="" |
|
|
|
onclick="refreshStatus({{.VersionName}})"><i |
|
|
|
class="redo icon redo-color"></i></span> |
|
|
|
<span id="refresh-status" data-tooltip="刷新" style="cursor: pointer;" data-inverted="" data-version="{{.VersionName}}"> |
|
|
|
<i class="redo icon redo-color"></i> |
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div style="float: right;"> |
|
|
@@ -871,64 +871,7 @@ |
|
|
|
size = size.toFixed(0);//保留的小数位数 |
|
|
|
return size + unitArr[index]; |
|
|
|
} |
|
|
|
function refreshStatus(version_name) { |
|
|
|
$.get(`/api/v1/repos/${userName}/${repoPath}/grampus/train-job/${jobID}?version_name=${version_name}`, (data) => { |
|
|
|
// header status and duration |
|
|
|
$(`#${version_name}-duration-span`).text(data.JobDuration) |
|
|
|
$(`#${version_name}-status-span span`).text(data.JobStatus) |
|
|
|
$(`#${version_name}-status-span i`).attr("class", data.JobStatus) |
|
|
|
// detail status and duration |
|
|
|
$('#' + version_name + '-duration').text(data.JobDuration) |
|
|
|
$('#' + version_name + '-status').text(data.JobStatus) |
|
|
|
$('#' + version_name + '-ai_center').text(data.AiCenter) |
|
|
|
loadLog(version_name) |
|
|
|
|
|
|
|
|
|
|
|
}).fail(function (err) { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
stopBubbling(arguments.callee.caller.arguments[0]) |
|
|
|
} |
|
|
|
function deleteVersion(version_name) { |
|
|
|
stopBubbling(arguments.callee.caller.arguments[0]) |
|
|
|
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) => { |
|
|
|
if (data.VersionListCount === 0) { |
|
|
|
location.href = `/${userName}/${repoPath}/modelarts/train-job` |
|
|
|
} else { |
|
|
|
$('#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') |
|
|
|
|
|
|
|
} |
|
|
|
function stopVersion(version_name) { |
|
|
|
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); |
|
|
|
}); |
|
|
|
} |
|
|
|
function loadLog(version_name) { |
|
|
|
document.getElementById("mask").style.display = "block" |
|
|
|
$.get(`/api/v1/repos/${userName}/${repoPath}/grampus/train-job/${jobID}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { |
|
|
|