diff --git a/templates/repo/modelarts/trainjob/index.tmpl b/templates/repo/modelarts/trainjob/index.tmpl
index 0f8f23490..52201e79d 100755
--- a/templates/repo/modelarts/trainjob/index.tmpl
+++ b/templates/repo/modelarts/trainjob/index.tmpl
@@ -121,7 +121,7 @@
-
+ {{.TrainJobDuration}}
@@ -253,35 +253,18 @@
}
}
- function loadJobDuration() {
- $(".job-status").each((index, job) => {
- const jobID = job.dataset.jobid;
- const repoPath = job.dataset.repopath;
- const versionname = job.dataset.version
- $.get(`/api/v1/repos/${repoPath}/modelarts/train-job/${jobID}?version_name=${versionname}`, (data) => {
- console.log(data)
- const duration = data.JobDuration
- const jobID = data.JobID
- $('#duration-'+jobID).text(duration)
- })
-
- })
- }
- $(document).ready(loadJobDuration);
// 加载任务状态
var timeid = window.setInterval(loadJobStatus, 15000);
$(document).ready(loadJobStatus);
function loadJobStatus() {
$(".job-status").each((index, job) => {
- const jobID = job.dataset.jobid;
- const repoPath = job.dataset.repopath;
+ const jobID = job.dataset.jobid
+ const repoPath = job.dataset.repopath
const versionname = job.dataset.version
- if (job.textContent.trim() == 'IMAGE_FAILED' || job.textContent.trim() == 'SUBMIT_FAILED' || job.textContent.trim() == 'DELETE_FAILED'
- || job.textContent.trim() == 'KILLED' || job.textContent.trim() == 'COMPLETED' || job.textContent.trim() == 'FAILED'
- || job.textContent.trim() == 'CANCELED' || job.textContent.trim() == 'LOST') {
- return
+ const status_text = $(`#${jobID}-text`).text()
+ if(['IMAGE_FAILED','SUBMIT_FAILED','DELETE_FAILED','KILLED','COMPLETED','FAILED','CANCELED','LOST','START_FAILED'].includes(status_text)){
+ return
}
-
$.get(`/api/v1/repos/${repoPath}/modelarts/train-job/${jobID}?version_name=${versionname}`, (data) => {
const jobID = data.JobID
const status = data.JobStatus
@@ -329,7 +312,6 @@
}
}
function stopVersion(version_name,jobID){
-
const url = '/api/v1/repos/{{$.RepoRelPath}}/modelarts/train-job/'+jobID+'/stop_version'
$.post(url,{version_name:version_name},(data)=>{
if(data.StatusOK===0){
diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl
index 67150e682..f6de05a36 100755
--- a/templates/repo/modelarts/trainjob/show.tmpl
+++ b/templates/repo/modelarts/trainjob/show.tmpl
@@ -450,7 +450,6 @@ td, th {
{{template "base/footer" .}}