Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/436tags/v1.21.12.1
| @@ -67,7 +67,7 @@ func CloudBrainIndex(ctx *context.Context) { | |||||
| timestamp := time.Now().Unix() | timestamp := time.Now().Unix() | ||||
| for i, task := range ciTasks { | for i, task := range ciTasks { | ||||
| if task.Status == string(models.JobRunning) && (timestamp-int64(task.CreatedUnix) > 30) { | |||||
| if task.Status == string(models.JobRunning) && (timestamp-int64(task.CreatedUnix) > 10) { | |||||
| ciTasks[i].CanDebug = true | ciTasks[i].CanDebug = true | ||||
| } else { | } else { | ||||
| ciTasks[i].CanDebug = false | ciTasks[i].CanDebug = false | ||||
| @@ -431,7 +431,8 @@ | |||||
| } | } | ||||
| // 加载任务状态 | // 加载任务状态 | ||||
| $(document).ready(function() { | |||||
| var timeid = window.setInterval(loadJobStatus, 15000); | |||||
| function loadJobStatus() { | |||||
| $(".job-status").each((index, job) => { | $(".job-status").each((index, job) => { | ||||
| const jobID = job.dataset.jobid; | const jobID = job.dataset.jobid; | ||||
| const repoPath = job.dataset.repopath; | const repoPath = job.dataset.repopath; | ||||
| @@ -442,13 +443,17 @@ | |||||
| $.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}`, (data) => { | $.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}`, (data) => { | ||||
| const jobID = data.JobID | const jobID = data.JobID | ||||
| const status = data.JobStatus | const status = data.JobStatus | ||||
| $('#' + jobID).text(status) | |||||
| // console.log(data) | |||||
| if (status != job.textContent.trim()) { | |||||
| //$('#' + jobID).text(status) | |||||
| //if (status == 'STOPPED') { | |||||
| window.location.reload() | |||||
| //} | |||||
| } | |||||
| }).fail(function(err) { | }).fail(function(err) { | ||||
| console.log(err); | console.log(err); | ||||
| }); | }); | ||||
| }); | }); | ||||
| }); | |||||
| }; | |||||
| // 获取弹窗 | // 获取弹窗 | ||||
| var modal = document.getElementById('imageModal'); | var modal = document.getElementById('imageModal'); | ||||
| @@ -418,7 +418,8 @@ | |||||
| } | } | ||||
| // 加载任务状态 | // 加载任务状态 | ||||
| $(document).ready(function() { | |||||
| var timeid = window.setInterval(loadJobStatus, 15000); | |||||
| function loadJobStatus() { | |||||
| $(".job-status").each((index, job) => { | $(".job-status").each((index, job) => { | ||||
| const jobID = job.dataset.jobid; | const jobID = job.dataset.jobid; | ||||
| const repoPath = job.dataset.repopath; | const repoPath = job.dataset.repopath; | ||||
| @@ -429,13 +430,17 @@ | |||||
| $.get(`/api/v1/repos/${repoPath}/modelarts/${jobID}`, (data) => { | $.get(`/api/v1/repos/${repoPath}/modelarts/${jobID}`, (data) => { | ||||
| const jobID = data.JobID | const jobID = data.JobID | ||||
| const status = data.JobStatus | const status = data.JobStatus | ||||
| $('#' + jobID).text(status) | |||||
| // console.log(data) | |||||
| if (status != job.textContent.trim()) { | |||||
| //$('#' + jobID).text(status) | |||||
| //if (status == 'STOPPED') { | |||||
| window.location.reload() | |||||
| //} | |||||
| } | |||||
| }).fail(function(err) { | }).fail(function(err) { | ||||
| console.log(err); | console.log(err); | ||||
| }); | }); | ||||
| }); | }); | ||||
| }); | |||||
| }; | |||||
| // 获取弹窗 | // 获取弹窗 | ||||
| var modal = document.getElementById('imageModal'); | var modal = document.getElementById('imageModal'); | ||||