-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathjobDetails.hbs
More file actions
281 lines (250 loc) · 7.81 KB
/
jobDetails.hbs
File metadata and controls
281 lines (250 loc) · 7.81 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
{{#unless displayJobInline}}
<h3>{{ this.id }}</h3>
{{#if this.name}}
<h5>Name</h5>
{{this.name}}
{{/if}}
{{/unless}}
<h5>Actions</h5>
<button class="btn btn-danger js-remove-job" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}"
data-job-id="{{ this.id }}" data-job-state="{{ jobState }}">
Remove
</button>
{{#if showRetryButton}}
<button class="btn btn-success js-retry-job" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}"
data-job-id="{{ this.id }}">
{{ retryButtonText }}
</button>
{{/if}}
{{#if showPromoteButton}}
<button class="btn btn-success js-promote-job" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}"
data-job-id="{{ this.id }}">
Promote
</button>
{{/if}}
{{#if showDeleteRepeatableButton}}
<button class="btn btn-danger js-remove-repeatable-job" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}"
data-job-id="{{ this.id }}" data-job-state="{{ jobState }}">
Remove Repeatable
</button>
{{/if}}
<div class="row">
<div class="col-sm-3">
<h5>State</h5>
{{capitalize jobState}}
</div>
<div class="col-sm-3">
<h5>Timestamp</h5>
{{#if queue.IS_BEE}}
{{#if this.options}}
{{#if (isNumber this.options.timestamp)}}
{{moment this.options.timestamp "llll"}}
{{/if}}
{{/if}}
{{else}}
{{#if (isNumber this.timestamp)}}
{{moment this.timestamp "llll"}}
{{/if}}
{{/if}}
</div>
{{#if this.processedOn}}
<div class="col-sm-3">
<h5>Processed</h5>
{{moment this.processedOn "llll"}}
</div>
{{/if}}
{{#if this.finishedOn}}
<div class="col-sm-3">
<h5>Finished</h5>
{{moment this.finishedOn "llll"}}
</div>
{{/if}}
{{#eq jobState 'delayed'}}
<div class="col-sm-3">
<h5>Executes At</h5>
{{moment (getDelayedExecutionAt this) "llll"}}
</div>
{{/eq}}
<div class="col-sm-3">
<h5>Attempts Made</h5>
{{this.attemptsMade}}
{{#if this.options}}
{{length this.options.stacktraces}}
{{/if}}
</div>
{{#if (isNumber this.attemptsStarted)}}
<div class="col-sm-3">
<h5>Attempts Started</h5>
{{this.attemptsStarted}}
</div>
{{/if}}
</div>
<div class="row">
<div class="col-sm-4">
<h5>Permalinks</h5>
{{#unless view}}
<a href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ encodeURI this.id }}" class="btn btn-info">Job
{{ this.id }}</a>
{{/unless}}
<a href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ encodeURI this.id }}?json=true"
class="btn btn-info">JSON</a>
</div>
</div>
{{#if this.queue.IS_BULL}}
<h5>Progress</h5>
{{#if (isNumber this._progress)}}
<div class="progress">
<div class="progress-bar
{{#eq jobState 'failed'}}
progress-bar-danger
{{/eq}}" role="progressbar" aria-valuenow="{{ this._progress }}" aria-valuemin="0" aria-valuemax="100"
style="width: {{ this._progress }}%; min-width: 2em;">
{{ this._progress }}%
</div>
</div>
{{else}}
<pre>{{json this._progress true}}</pre>
{{/if}}
{{else if this.queue.IS_BULLMQ}}
<h5>Progress</h5>
{{#if (isNumber this.progress)}}
<div class="progress">
<div class="progress-bar
{{#eq jobState 'failed'}}
progress-bar-danger
{{/eq}}" role="progressbar" aria-valuenow="{{ this.progress }}" aria-valuemin="0" aria-valuemax="100"
style="width: {{ this.progress }}%; min-width: 2em;">
{{ this.progress }}%
</div>
</div>
{{else}}
<pre>{{json this.progress true}}</pre>
{{/if}}
{{/if}}
{{#if this.returnvalue}}
<h5>Return Value</h5>
<pre><code class="json">{{json this.returnvalue true}}</code></pre>
{{/if}}
{{#if this.failedReason}}
<h5>Reason for failure</h5>
<pre><code>{{this.failedReason}}</code></pre>
{{/if}}
{{#if stacktraces}}
<h5>Stacktraces</h5>
{{#each stacktraces}}
<pre>{{ this }}</pre>
{{/each}}
{{/if}}
<h5>Data</h5>
{{#unless queue.IS_BEE}}
{{#if view }}
<div class="panel with-nav-tabs panel-primary">
<ul class="nav nav-tabs nav-justified">
<li class="active"><a href="#tab1primary" data-toggle="tab">View</a></li>
<li><a class="text-white" href="#tab2primary" data-toggle="tab">Edit</a></li>
</ul>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade in active" id="tab1primary">
{{/if}}
{{/unless}}
<pre><code class="json">{{json this.data true}}</code></pre>
{{#unless queue.IS_BEE}}
{{#if view }}
</div>
<div class="tab-pane fade" id="tab2primary">
<div class="jsoneditorx" id="jsoneditor" style="height:300px;"></div>
<br />
<div class="form-inline pull-right">
<div class="js-update-job-data btn btn-primary btn-sm" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}"
data-job-id="{{ this.id }}">Update</div>
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{/unless}}
{{#if this.queue.IS_BULLMQ}}
{{#if this.parent }}
<div class="row">
<div class="col-sm-12">
<h5>Parent</h5>
<a href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI this.parent.queueName }}/{{ this.parent.id }}">
<span class="label label-default">{{ this.parent.id }}</span>
</a>
</div>
</div>
{{/if}}
{{#if this.unprocessedChildren }}
<div class="row">
<div class="col-sm-12">
<h5>Unprocessed Children <span class="count">{{ this.countDependencies.unprocessed}}</span></h5>
<nav aria-label="Unprocessed navigation">
<ul class="pagination">
<li><a
href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ encodeURI this.id }}?unprocessedCursor={{ this.unprocessedCursor }}&unprocessedCount={{ this.unprocessedCount }}"
aria-label="Previous">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
{{#each this.unprocessedChildren}}
<a href="{{ ../basePath }}/{{ encodeURI ../queueHost }}/{{ encodeURI this.queueName }}/{{ encodeURI this.id }}">
<span class="label label-danger">{{ this.id }}</span>
</a>
{{/each}}
</div>
</div>
{{/if}}
{{#if this.processedChildren }}
<div class="row">
<div class="col-sm-12">
<h5>Processed Children <span class="count">{{ this.countDependencies.processed}}</span></h5>
<nav aria-label="Processed navigation">
<ul class="pagination">
<li><a
href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ encodeURI this.id }}?processedCursor={{ this.processedCursor }}&processedCount={{ this.processedCount }}"
aria-label="Previous">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
{{#each this.processedChildren}}
<a href="{{ ../basePath }}/{{ encodeURI ../queueHost }}/{{ encodeURI this.queueName }}/{{ encodeURI this.id }}">
<span class="label label-success">{{ this.id }}</span>
</a>
{{/each}}
</div>
</div>
{{/if}}
{{#if this.ignoredChildren }}
<div class="row">
<div class="col-sm-12">
<h5>Ignored Children <span class="count">{{ this.countDependencies.ignored}}</span></h5>
<nav aria-label="Ignored navigation">
<ul class="pagination">
<li><a
href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ encodeURI this.id }}?ignoredCursor={{ this.ignoredCursor }}&ignoredCount={{ this.ignoredCount }}"
aria-label="Previous">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
{{#each this.ignoredChildren}}
<a href="{{ ../basePath }}/{{ encodeURI ../queueHost }}/{{ encodeURI this.queueName }}/{{ encodeURI this.id }}">
<span class="label label-warning">{{ this.id }}</span>
</a>
{{/each}}
</div>
</div>
{{/if}}
<br>
{{/if}}
{{#if this.logs}}
<h5>Logs</h5>
<pre><code class="json">{{json this.logs true}}</code></pre>
{{/if}}