Skip to content

Commit bd0d697

Browse files
GabrielCastroEli Skeggs
authored andcommitted
feat(job-details): show raw progress when not numeric
1 parent 63ca0c8 commit bd0d697

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

src/server/views/helpers/handlebars.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const helpers = {
2323
return new Handlebars.SafeString(JSON.stringify(...args));
2424
},
2525

26+
isNumber(operand) {
27+
return parseInt(operand, 10).toString() === String(operand);
28+
},
29+
2630
adjustedPage(currentPage, pageSize, newPageSize) {
2731
const firstId = (currentPage - 1) * pageSize;
2832
return _.ceil(firstId / newPageSize) + 1;

src/server/views/partials/dashboard/jobDetails.hbs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,23 @@
4949

5050
{{#unless this.queue.IS_BEE}}
5151
<h5>Progress</h5>
52-
<div class="progress">
53-
<div class="progress-bar
54-
{{#eq jobState 'failed'}}
55-
progress-bar-danger
56-
{{/eq}}"
57-
role="progressbar"
58-
aria-valuenow="{{ this._progress }}"
59-
aria-valuemin="0"
60-
aria-valuemax="100"
61-
style="width: {{ this._progress }}%; min-width: 2em;">
62-
{{ this._progress }}%
52+
{{#if (isNumber this._progress)}}
53+
<div class="progress">
54+
<div class="progress-bar
55+
{{#eq jobState 'failed'}}
56+
progress-bar-danger
57+
{{/eq}}"
58+
role="progressbar"
59+
aria-valuenow="{{ this._progress }}"
60+
aria-valuemin="0"
61+
aria-valuemax="100"
62+
style="width: {{ this._progress }}%; min-width: 2em;">
63+
{{ this._progress }}%
64+
</div>
6365
</div>
64-
</div>
66+
{{else}}
67+
<pre>{{json this._progress true}}</pre>
68+
{{/if}}
6569
{{/unless}}
6670

6771
{{#if this.returnvalue}}

0 commit comments

Comments
 (0)