|
|
@@ -271,19 +271,28 @@ |
|
|
|
|
|
|
|
<div class="three wide column"> |
|
|
|
<!--任务状态 --> |
|
|
|
<!-- <span class="ui compact button job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}"> |
|
|
|
{{.Status}} |
|
|
|
<span class="job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}"> |
|
|
|
<!-- {{.Status}} --> |
|
|
|
<!-- {{if eq .Status "RUNNING"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-stop"></i><span style="margin-left: 0.4em;font-size: 12px;">运行中</span></span> |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-stop"></i><span style="margin-left: 0.4em;font-size: 12px;">运行中</span></span> |
|
|
|
{{else}} |
|
|
|
{{.Status}} |
|
|
|
{{end}} --> |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="{{.Status}}"></i><span style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> |
|
|
|
</span> |
|
|
|
<!-- <span class="job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}" > |
|
|
|
{{if eq .Status "STOPPED"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-stop"></i><span style="margin-left: 0.4em;font-size: 12px;">已停止</span></span> |
|
|
|
{{else if eq .Status "RUNNING"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-running"></i><span style="margin-left: 0.4em;font-size: 12px;">运行中</span></span> |
|
|
|
{{else if eq .Status "FAILED"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-running"></i><span style="margin-left: 0.4em;font-size: 12px;">运行失败</span></span> |
|
|
|
{{else if eq .Status "WAITING"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="showCircle"></i><span style="margin-left: 0.4em;font-size: 12px;">初始化等待</span></span> |
|
|
|
{{end}} |
|
|
|
</span> --> |
|
|
|
{{if eq .Status "STOPPED"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-stop"></i><span style="margin-left: 0.4em;font-size: 12px;">已停止</span></span> |
|
|
|
{{else if eq .Status "RUNNING"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-running"></i><span style="margin-left: 0.4em;font-size: 12px;">运行中</span></span> |
|
|
|
{{else if eq .Status "FAILED"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-running"></i><span style="margin-left: 0.4em;font-size: 12px;">运行失败</span></span> |
|
|
|
{{else if eq .Status "WAITING"}} |
|
|
|
<span style="display:flex;position: relative; justify-content: flex-start;"><i class="showCircle"></i><span style="margin-left: 0.4em;font-size: 12px;">初始化等待</span></span> |
|
|
|
|
|
|
|
{{end}} |
|
|
|
<!-- 任务创建时间 --> |
|
|
|
<span class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span> |
|
|
|
</div> |
|
|
@@ -456,15 +465,18 @@ |
|
|
|
$(document).ready(loadJobStatus); |
|
|
|
function loadJobStatus() { |
|
|
|
$(".job-status").each((index, job) => { |
|
|
|
console.log("---------",index,job) |
|
|
|
const jobID = job.dataset.jobid; |
|
|
|
const repoPath = job.dataset.repopath; |
|
|
|
if (job.textContent.trim() == 'STOPPED') { |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
$.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}`, (data) => { |
|
|
|
const jobID = data.JobID |
|
|
|
const status = data.JobStatus |
|
|
|
console.log("status",status) |
|
|
|
if (status != job.textContent.trim()) { |
|
|
|
//$('#' + jobID).text(status) |
|
|
|
//if (status == 'STOPPED') { |
|
|
|