This repository has been archived by the owner on Feb 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
jobdetail.js
48 lines (48 loc) · 1.81 KB
/
jobdetail.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const jobDetail = Vue.component('job-detail', {
props: ['job'],
filters: {
formatJSON(jsonstr){
return JSON.stringify(jsonstr, null, 2);
},
},
methods: {
formatDate(date){
return moment(date).format('DD-MM-YYYY HH:mm:ss')
}
},
template: `
<div class="modal fade" id="modalData" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<!-- Modal -->
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Job Data - {{job.job.name}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row my-3">
<div class="col">
<p><strong>Next run starts: </strong>{{ formatDate(job.job.lastRunAt) }}</p>
<p><strong>Last run started: </strong>{{ formatDate(job.job.lastRunAt) }}</p>
</div>
</div>
<p><strong>Metadata: </strong></p>
<prism-editor class="json-editor" :lineNumbers="true" :readonly="true" :code="job.job.data | formatJSON" language="json"></prism-editor>
<div v-if='job.failed' class="row mt-3">
<div class="col pt-3 bg-danger text-light">
<p><strong>Fail Count:</strong> {{job.job.failCount}}</p>
<p><strong>Failed At:</strong> {{formatDate(job.job.failedAt)}}</p>
<p><strong>Reason:</strong> {{job.job.failReason}}</p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
`
})