Skip to content

Commit 4c7643c

Browse files
author
Brad Vogel
authored
Merge pull request #339 from roggervalf/fix-capitalize-function
Fix capitalize function
2 parents 440cbbe + 48ca96a commit 4c7643c

3 files changed

Lines changed: 44 additions & 28 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Arena
22

3+
[![NPM](https://img.shields.io/npm/v/bull-arena.svg)](https://www.npmjs.com/package/bull-arena) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![NPM downloads](https://img.shields.io/npm/dm/bull-arena)](https://www.npmjs.com/package/bull-arena) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
4+
35
An intuitive Web GUI for [Bee Queue](https://github.com/bee-queue/bee-queue) and [Bull](https://github.com/optimalbits/bull). Built on Express so you can run Arena standalone, or mounted in another app as middleware.
46

57
For a quick introduction to the motivations for creating Arena, read _[Interactively monitoring Bull, a Redis-backed job queue for Node](https://www.mixmax.com/blog/introducing-bull-arena)_.

src/server/views/helpers/handlebars.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ const helpers = {
6868
return encodeURIComponent(url);
6969
},
7070

71-
capitalize(s) {
71+
capitalize(value) {
7272
if (typeof value !== 'string') {
7373
return '';
7474
}
75-
return s.charAt(0).toUpperCase() + s.slice(1);
75+
return value.charAt(0).toUpperCase() + value.slice(1);
7676
},
7777

7878
add(a, b) {
Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{{#unless displayJobInline}}
2-
<h3>{{ this.id }}</h3>
2+
<h3>{{ this.id }}</h3>
33
{{/unless}}
44

55
<h5>Actions</h5>
6-
<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 }}">
6+
<button class="btn btn-danger js-remove-job" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}"
7+
data-job-id="{{ this.id }}" data-job-state="{{ jobState }}">
78
Remove
89
</button>
910

1011
{{#if showRetryButton}}
11-
<button class="btn btn-success js-retry-job" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}" data-job-id="{{ this.id }}">
12-
{{ retryButtonText }}
13-
</button>
12+
<button class="btn btn-success js-retry-job" data-queue-host="{{ queueHost }}" data-queue-name="{{ queueName }}"
13+
data-job-id="{{ this.id }}">
14+
{{ retryButtonText }}
15+
</button>
1416
{{/if}}
1517

1618

@@ -23,48 +25,60 @@
2325
<div class="col-sm-3">
2426
<h5>Timestamp</h5>
2527
{{#if this.options.timestamp}}
26-
{{moment this.options.timestamp "llll"}}
28+
{{moment this.options.timestamp "llll"}}
2729
{{/if}}
2830
{{#if this.timestamp}}
29-
{{moment this.timestamp "llll"}}
31+
{{moment this.timestamp "llll"}}
3032
{{/if}}
3133
</div>
3234

35+
{{#if this.processedOn}}
36+
<div class="col-sm-3">
37+
<h5>Processed On</h5>
38+
{{moment this.processedOn "llll"}}
39+
</div>
40+
{{/if}}
41+
42+
{{#if this.finishedOn}}
43+
<div class="col-sm-3">
44+
<h5>Finished On</h5>
45+
{{moment this.finishedOn "llll"}}
46+
</div>
47+
{{/if}}
48+
3349
<div class="col-sm-3">
3450
<h5>Attempts Made</h5>
3551
{{this.attemptsMade}}
3652

3753
{{#if this.options}}
38-
{{length this.options.stacktraces}}
54+
{{length this.options.stacktraces}}
3955
{{/if}}
4056
</div>
4157
</div>
4258
<div class="row">
4359
<div class="col-sm-4">
4460
<h5>Permalinks</h5>
45-
<a href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ this.id }}" class="btn btn-info">Job {{ this.id }}</a>
46-
<a href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ this.id }}?json=true" class="btn btn-info">JSON</a>
61+
<a href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ this.id }}" class="btn btn-info">Job
62+
{{ this.id }}</a>
63+
<a href="{{ basePath }}/{{ encodeURI queueHost }}/{{ encodeURI queueName }}/{{ this.id }}?json=true"
64+
class="btn btn-info">JSON</a>
4765
</div>
4866
</div>
4967

5068
{{#unless this.queue.IS_BEE}}
5169
<h5>Progress</h5>
5270
{{#if (isNumber this._progress)}}
53-
<div class="progress">
54-
<div class="progress-bar
71+
<div class="progress">
72+
<div class="progress-bar
5573
{{#eq jobState 'failed'}}
5674
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>
75+
{{/eq}}" role="progressbar" aria-valuenow="{{ this._progress }}" aria-valuemin="0" aria-valuemax="100"
76+
style="width: {{ this._progress }}%; min-width: 2em;">
77+
{{ this._progress }}%
6578
</div>
79+
</div>
6680
{{else}}
67-
<pre>{{json this._progress true}}</pre>
81+
<pre>{{json this._progress true}}</pre>
6882
{{/if}}
6983
{{/unless}}
7084

@@ -79,15 +93,15 @@
7993
{{/if}}
8094

8195
{{#if stacktraces}}
82-
<h5>Stacktraces</h5>
83-
{{#each stacktraces}}
84-
<pre>{{ this }}</pre>
85-
{{/each}}
96+
<h5>Stacktraces</h5>
97+
{{#each stacktraces}}
98+
<pre>{{ this }}</pre>
99+
{{/each}}
86100
{{/if}}
87101

88102

89103
<h5>Data</h5>
90104
<pre><code class="json">{{json this.data true}}</code></pre>
91105

92106
<h5>Logs</h5>
93-
<pre><code class="json">{{json this.logs true}}</code></pre>
107+
<pre><code class="json">{{json this.logs true}}</code></pre>

0 commit comments

Comments
 (0)