better_delayed_job_web 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +109 -0
- data/Rakefile +22 -0
- data/better_delayed_job_web.gemspec +33 -0
- data/bin/delayed_job_web +10 -0
- data/lib/delayed_job_web/application/app.rb +203 -0
- data/lib/delayed_job_web/application/public/images/poll.png +0 -0
- data/lib/delayed_job_web/application/public/javascripts/application.js +64 -0
- data/lib/delayed_job_web/application/public/javascripts/bootstrap.min.js +7 -0
- data/lib/delayed_job_web/application/public/javascripts/jquery-1.11.2.min.js +4 -0
- data/lib/delayed_job_web/application/public/javascripts/jquery.relatize_date.js +117 -0
- data/lib/delayed_job_web/application/public/javascripts/material.js +52 -0
- data/lib/delayed_job_web/application/public/stylesheets/bootstrap.css +6832 -0
- data/lib/delayed_job_web/application/public/stylesheets/material.css +169 -0
- data/lib/delayed_job_web/application/public/stylesheets/reset.css +44 -0
- data/lib/delayed_job_web/application/public/stylesheets/style.css +58 -0
- data/lib/delayed_job_web/application/views/enqueued.erb +13 -0
- data/lib/delayed_job_web/application/views/error.erb +2 -0
- data/lib/delayed_job_web/application/views/failed.erb +26 -0
- data/lib/delayed_job_web/application/views/job.erb +64 -0
- data/lib/delayed_job_web/application/views/layout.erb +53 -0
- data/lib/delayed_job_web/application/views/next_more.erb +11 -0
- data/lib/delayed_job_web/application/views/overview.erb +90 -0
- data/lib/delayed_job_web/application/views/pending.erb +22 -0
- data/lib/delayed_job_web/application/views/stats.erb +38 -0
- data/lib/delayed_job_web/application/views/working.erb +16 -0
- data/lib/delayed_job_web/railtie.rb +7 -0
- data/lib/delayed_job_web.rb +2 -0
- data/test/integration/test_mounted_in_rails_app.rb +19 -0
- data/test/lib/delayed_job_web/application/test_app.rb +67 -0
- data/test/support/delayed_job_fake.rb +34 -0
- data/test/support/rails_app.rb +12 -0
- data/test/test_helper.rb +7 -0
- metadata +164 -0
@@ -0,0 +1,169 @@
|
|
1
|
+
body {
|
2
|
+
/*padding-top: 50px;*/
|
3
|
+
}
|
4
|
+
body>.navbar {
|
5
|
+
-webkit-transition: background-color 300ms ease-in;
|
6
|
+
transition: background-color 300ms ease-in;
|
7
|
+
}
|
8
|
+
body>.navbar-transparent {
|
9
|
+
background-color: transparent;
|
10
|
+
}
|
11
|
+
body>.navbar-transparent .navbar-nav>.open>a {
|
12
|
+
background-color: transparent !important;
|
13
|
+
}
|
14
|
+
#home {
|
15
|
+
padding-top: 0;
|
16
|
+
}
|
17
|
+
#home .navbar-brand {
|
18
|
+
padding: 13.5px 15px 12.5px;
|
19
|
+
}
|
20
|
+
#home .navbar-brand>img {
|
21
|
+
display: inline;
|
22
|
+
margin: 0 8px;
|
23
|
+
height: 100%}
|
24
|
+
#banner {
|
25
|
+
min-height: 300px;
|
26
|
+
border-bottom: none;
|
27
|
+
}
|
28
|
+
.page-header h1 {
|
29
|
+
font-size: 4em;
|
30
|
+
}
|
31
|
+
.bs-docs-section {
|
32
|
+
margin-top: 8em;
|
33
|
+
}
|
34
|
+
.bs-component {
|
35
|
+
position: relative;
|
36
|
+
}
|
37
|
+
.bs-component .modal {
|
38
|
+
position: relative;
|
39
|
+
top: auto;
|
40
|
+
right: auto;
|
41
|
+
left: auto;
|
42
|
+
bottom: auto;
|
43
|
+
z-index: 1;
|
44
|
+
display: block;
|
45
|
+
}
|
46
|
+
.bs-component .modal-dialog {
|
47
|
+
width: 90%}
|
48
|
+
.bs-component .popover {
|
49
|
+
position: relative;
|
50
|
+
display: inline-block;
|
51
|
+
width: 220px;
|
52
|
+
margin: 20px;
|
53
|
+
}
|
54
|
+
#source-button {
|
55
|
+
position: absolute;
|
56
|
+
top: 0;
|
57
|
+
right: 0;
|
58
|
+
z-index: 100;
|
59
|
+
font-weight: bold;
|
60
|
+
}
|
61
|
+
.nav-tabs {
|
62
|
+
margin-bottom: 15px;
|
63
|
+
}
|
64
|
+
.progress {
|
65
|
+
margin-bottom: 10px;
|
66
|
+
}
|
67
|
+
footer {
|
68
|
+
margin: 5em 0;
|
69
|
+
}
|
70
|
+
footer li {
|
71
|
+
float: left;
|
72
|
+
margin-right: 1.5em;
|
73
|
+
margin-bottom: 1.5em;
|
74
|
+
}
|
75
|
+
footer p {
|
76
|
+
clear: left;
|
77
|
+
margin-bottom: 0;
|
78
|
+
}
|
79
|
+
.splash {
|
80
|
+
padding: 9em 0 2em;
|
81
|
+
background-color: #141d27;
|
82
|
+
background-image: url(../img/bg.jpg);
|
83
|
+
background-size: cover;
|
84
|
+
background-attachment: fixed;
|
85
|
+
color: #fff;
|
86
|
+
text-align: center;
|
87
|
+
}
|
88
|
+
.splash .logo {
|
89
|
+
width: 160px;
|
90
|
+
}
|
91
|
+
.splash h1 {
|
92
|
+
font-size: 3em;
|
93
|
+
}
|
94
|
+
.splash #social {
|
95
|
+
margin: 2em 0;
|
96
|
+
}
|
97
|
+
.splash .alert {
|
98
|
+
margin: 2em 0;
|
99
|
+
}
|
100
|
+
.section-tout {
|
101
|
+
padding: 4em 0 3em;
|
102
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
103
|
+
background-color: #eaf1f1;
|
104
|
+
}
|
105
|
+
.section-tout .fa {
|
106
|
+
margin-right: .5em;
|
107
|
+
}
|
108
|
+
.section-tout p {
|
109
|
+
margin-bottom: 3em;
|
110
|
+
}
|
111
|
+
.section-preview {
|
112
|
+
padding: 4em 0 4em;
|
113
|
+
}
|
114
|
+
.section-preview .preview {
|
115
|
+
margin-bottom: 4em;
|
116
|
+
background-color: #eaf1f1;
|
117
|
+
}
|
118
|
+
.section-preview .preview .image {
|
119
|
+
position: relative;
|
120
|
+
}
|
121
|
+
.section-preview .preview .image:before {
|
122
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
123
|
+
position: absolute;
|
124
|
+
top: 0;
|
125
|
+
left: 0;
|
126
|
+
width: 100%;
|
127
|
+
height: 100%;
|
128
|
+
content: "";
|
129
|
+
pointer-events: none;
|
130
|
+
}
|
131
|
+
.section-preview .preview .options {
|
132
|
+
padding: 1em 2em 2em;
|
133
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
134
|
+
border-top: none;
|
135
|
+
text-align: center;
|
136
|
+
}
|
137
|
+
.section-preview .preview .options p {
|
138
|
+
margin-bottom: 2em;
|
139
|
+
}
|
140
|
+
.section-preview .dropdown-menu {
|
141
|
+
text-align: left;
|
142
|
+
}
|
143
|
+
.section-preview .lead {
|
144
|
+
margin-bottom: 2em;
|
145
|
+
}
|
146
|
+
@media (max-width:767px) {
|
147
|
+
.section-preview .image img {
|
148
|
+
width: 100%}
|
149
|
+
}.sponsor {
|
150
|
+
text-align: center;
|
151
|
+
}
|
152
|
+
.sponsor a:hover {
|
153
|
+
text-decoration: none;
|
154
|
+
}
|
155
|
+
@media (max-width:767px) {
|
156
|
+
.splash {
|
157
|
+
padding-top: 4em;
|
158
|
+
}
|
159
|
+
.splash .logo {
|
160
|
+
width: 100px;
|
161
|
+
}
|
162
|
+
.splash h1 {
|
163
|
+
font-size: 2em;
|
164
|
+
}
|
165
|
+
#banner {
|
166
|
+
margin-bottom: 2em;
|
167
|
+
text-align: center;
|
168
|
+
}
|
169
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
html, body, div, span, applet, object, iframe,
|
2
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
3
|
+
a, abbr, acronym, address, big, cite, code,
|
4
|
+
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
5
|
+
small, strike, strong, sub, sup, tt, var,
|
6
|
+
dl, dt, dd, ul, li,
|
7
|
+
form, label, legend,
|
8
|
+
table, caption, tbody, tfoot, thead, tr, th, td {
|
9
|
+
margin: 0;
|
10
|
+
padding: 0;
|
11
|
+
border: 0;
|
12
|
+
outline: 0;
|
13
|
+
font-weight: inherit;
|
14
|
+
font-style: normal;
|
15
|
+
font-size: 100%;
|
16
|
+
font-family: inherit;
|
17
|
+
}
|
18
|
+
|
19
|
+
body {
|
20
|
+
line-height: 1;
|
21
|
+
}
|
22
|
+
|
23
|
+
ul {
|
24
|
+
list-style: none;
|
25
|
+
}
|
26
|
+
|
27
|
+
table {
|
28
|
+
border-collapse: collapse;
|
29
|
+
border-spacing: 0;
|
30
|
+
}
|
31
|
+
|
32
|
+
caption, th, td {
|
33
|
+
text-align: left;
|
34
|
+
font-weight: normal;
|
35
|
+
}
|
36
|
+
|
37
|
+
blockquote:before, blockquote:after,
|
38
|
+
q:before, q:after {
|
39
|
+
content: "";
|
40
|
+
}
|
41
|
+
|
42
|
+
blockquote, q {
|
43
|
+
quotes: "" "";
|
44
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#main table a {
|
2
|
+
color: #000;
|
3
|
+
text-decoration: none;
|
4
|
+
}
|
5
|
+
|
6
|
+
#main table a:hover {
|
7
|
+
color: #000;
|
8
|
+
text-decoration: underline;
|
9
|
+
}
|
10
|
+
|
11
|
+
#main table th {
|
12
|
+
font-weight: bold;
|
13
|
+
}
|
14
|
+
|
15
|
+
/* Sticky footer styles
|
16
|
+
-------------------------------------------------- */
|
17
|
+
|
18
|
+
html,
|
19
|
+
body {
|
20
|
+
height: 100%;
|
21
|
+
/* The html and body elements cannot have any padding or margin. */
|
22
|
+
}
|
23
|
+
|
24
|
+
/* Wrapper for page content to push down footer */
|
25
|
+
#wrap {
|
26
|
+
min-height: 100%;
|
27
|
+
height: auto !important;
|
28
|
+
height: 100%;
|
29
|
+
/* Negative indent footer by it's height */
|
30
|
+
margin: 0 auto -60px;
|
31
|
+
}
|
32
|
+
|
33
|
+
/* Set the fixed height of the footer here */
|
34
|
+
#push,
|
35
|
+
#footer {
|
36
|
+
height: 60px;
|
37
|
+
}
|
38
|
+
#footer {
|
39
|
+
background-color: #f5f5f5;
|
40
|
+
}
|
41
|
+
|
42
|
+
/* Lastly, apply responsive CSS fixes as necessary */
|
43
|
+
@media (max-width: 767px) {
|
44
|
+
#footer {
|
45
|
+
margin-left: -20px;
|
46
|
+
margin-right: -20px;
|
47
|
+
padding-left: 20px;
|
48
|
+
padding-right: 20px;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
.container .credit {
|
53
|
+
margin: 20px 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
code {
|
57
|
+
font-size: 80%;
|
58
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h2 class="sub-header">Enqueued</h2>
|
2
|
+
<p class="text-info">
|
3
|
+
The list below contains all jobs currently in the delayed_job queue.
|
4
|
+
</p>
|
5
|
+
<p class="sub">
|
6
|
+
<%= "Showing #{start} to #{start + per_page} of #{@all_jobs.count} enqueued jobs." %>
|
7
|
+
</p>
|
8
|
+
<ul class="job">
|
9
|
+
<% @jobs.each do |job| %>
|
10
|
+
<%= partial :job, {:job => job} %>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
<%= partial :next_more, :start => start, :total_size => @all_jobs.count, :per_page => per_page %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<h2 class="sub-header">Failed Jobs</h2>
|
2
|
+
<p class="text-info">
|
3
|
+
Here are the list of jobs that failed during execution.
|
4
|
+
</p>
|
5
|
+
<% if @jobs.any? %>
|
6
|
+
<form action="<%= u('failed/clear') %>" method="POST">
|
7
|
+
<%= csrf_token_tag %>
|
8
|
+
<input type="submit" value="Clear Failed Jobs"></input>
|
9
|
+
</form>
|
10
|
+
<form action="<%= u('requeue/all') %>" method="POST">
|
11
|
+
<%= csrf_token_tag %>
|
12
|
+
<input type="submit" value="Retry Failed Jobs"></input>
|
13
|
+
</form>
|
14
|
+
<% end %>
|
15
|
+
<p class="text-info">
|
16
|
+
The list below contains all jobs that have a last_error message set.
|
17
|
+
</p>
|
18
|
+
<p class="sub">
|
19
|
+
<%= "Showing #{start} to #{start + per_page} of #{@all_jobs.count} failed jobs." %>
|
20
|
+
</p>
|
21
|
+
<ul class="failed job">
|
22
|
+
<% @jobs.each do |job| %>
|
23
|
+
<%= partial :job, {:job => job} %>
|
24
|
+
<% end %>
|
25
|
+
</ul>
|
26
|
+
<%= partial :next_more, :start => start, :total_size => @all_jobs.count, :per_page => per_page %>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<li class="list-group-item">
|
2
|
+
<dl>
|
3
|
+
<dt>ID</dt>
|
4
|
+
<dd>
|
5
|
+
<a name="<%= job.id %>"></a>
|
6
|
+
<a href="#<%= job.id %>"><%=h job.id %></a>
|
7
|
+
<div class="controls">
|
8
|
+
<form action="<%= u("requeue/#{job.id}") %>" method="post"><%= csrf_token_tag %><input type="submit" value="Retry"></input></form>
|
9
|
+
or
|
10
|
+
<form action="<%= u("remove/#{job.id}") %>" method="post"><%= csrf_token_tag %><input type="submit" value="Remove"></input></form>
|
11
|
+
or
|
12
|
+
<form action="<%= u("reload/#{job.id}") %>" method="post"><%= csrf_token_tag %><input type="submit" value="Reload"></input></form>
|
13
|
+
</div>
|
14
|
+
</dd>
|
15
|
+
<dt>Priority</dt>
|
16
|
+
<dd><%=h job.priority %></dd>
|
17
|
+
<dt>Attempts</dt>
|
18
|
+
<dd><%=h job.attempts %></dd>
|
19
|
+
<% if job.respond_to?(:queue) && job.queue %>
|
20
|
+
<dt>Queue</dt>
|
21
|
+
<dd><%=h job.queue %></dd>
|
22
|
+
<% end %>
|
23
|
+
<dt>Handler</dt>
|
24
|
+
<dd>
|
25
|
+
<pre><%=h job.handler %></pre>
|
26
|
+
</dd>
|
27
|
+
<% if job.last_error %>
|
28
|
+
<dt>Last Error</dt>
|
29
|
+
<dd>
|
30
|
+
<div class="backtrace">
|
31
|
+
<pre><%=h job.last_error[0..100] + '...' %></pre>
|
32
|
+
</div>
|
33
|
+
<a class="backtrace" href="#">Toggle full message</a>
|
34
|
+
<div class="backtrace full hide">
|
35
|
+
<pre><%=h job.last_error %></pre>
|
36
|
+
</div>
|
37
|
+
</dd>
|
38
|
+
<% end %>
|
39
|
+
<% if job.run_at %>
|
40
|
+
<dt>Run At</dt>
|
41
|
+
<dd class="time">
|
42
|
+
<%=h job.run_at.rfc822 %>
|
43
|
+
</dd>
|
44
|
+
<% end %>
|
45
|
+
<% if job.locked_at %>
|
46
|
+
<dt>Locked At</dt>
|
47
|
+
<dd class="time">
|
48
|
+
<%=h job.locked_at.rfc822 %>
|
49
|
+
</dd>
|
50
|
+
<% end %>
|
51
|
+
<% if job.locked_by %>
|
52
|
+
<dt>Locked By</dt>
|
53
|
+
<dd>
|
54
|
+
<%=h job.locked_by %>
|
55
|
+
</dd>
|
56
|
+
<% end %>
|
57
|
+
<% if job.failed_at %>
|
58
|
+
<dt>Failed At</dt>
|
59
|
+
<dd>
|
60
|
+
<%=h job.failed_at %>
|
61
|
+
</dd>
|
62
|
+
<% end %>
|
63
|
+
</dl>
|
64
|
+
</li>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Delayed Job Web</title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="stylesheets/reset.css" />
|
6
|
+
<link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
|
7
|
+
<link rel="stylesheet" type="text/css" href="stylesheets/bootstrap.css" />
|
8
|
+
<link rel="stylesheet" type="text/css" href="stylesheets/material.css" />
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="wrap">
|
12
|
+
<div class="navbar navbar-inverse">
|
13
|
+
<div class="navbar-header">
|
14
|
+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-inverse-collapse">
|
15
|
+
<span class="icon-bar"></span>
|
16
|
+
<span class="icon-bar"></span>
|
17
|
+
<span class="icon-bar"></span>
|
18
|
+
</button>
|
19
|
+
<a class="navbar-brand" href="#">Jobs</a>
|
20
|
+
</div>
|
21
|
+
<div class="navbar-collapse collapse navbar-inverse-collapse">
|
22
|
+
<ul class="nav navbar-nav">
|
23
|
+
<li><a href="<%= u('/overview') %>">Overview</a></li>
|
24
|
+
<li><a href="<%= u('/enqueued') %>">Enqueued</a></li>
|
25
|
+
<li><a href="<%= u('/working') %>">Working</a></li>
|
26
|
+
<li><a href="<%= u('/pending') %>">Pending</a></li>
|
27
|
+
<li><a href="<%= u('/failed') %>">Failed</a></li>
|
28
|
+
</ul>
|
29
|
+
<form class="navbar-form navbar-left">
|
30
|
+
<input name="queues" type="text" value="<%=h @queues.join(", ") %>" style="width: 300px;" class="form-control col-lg-8" placeholder="Search for queues" />
|
31
|
+
</form>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
<div class="container" id="main">
|
35
|
+
<div class="row">
|
36
|
+
<%= yield %>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div id="push"></div>
|
40
|
+
</div>
|
41
|
+
<div id="footer">
|
42
|
+
<div class="container">
|
43
|
+
<p class="muted credit">Powered by <a href="https://github.com/collectiveidea/delayed_job">delayed_job</a> and <a href="https://github.com/ejschmitt/delayed_job_web">delayed_job_web</a>.</p>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<script src="<%= u("javascripts/jquery-1.11.2.min.js") %>" type="text/javascript"></script>
|
48
|
+
<script src="<%= u("javascripts/jquery.relatize_date.js") %>" type="text/javascript"></script>
|
49
|
+
<script src="<%= u("javascripts/application.js") %>" type="text/javascript"></script>
|
50
|
+
<script src="<%= u("javascripts/bootstrap.min.js") %>" type="text/javascript"></script>
|
51
|
+
<script src="<%= u("javascripts/material.js") %>" type="text/javascript"></script>
|
52
|
+
</body>
|
53
|
+
</html>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if start - per_page >= 0 || start + per_page <= total_size %>
|
2
|
+
<% divider = @queues.empty? ? "?" : "&" %>
|
3
|
+
<p class="pagination">
|
4
|
+
<% if start - per_page >= 0 %>
|
5
|
+
<a class="less" href="<%= current_page %><%= divider %>start=<%= start - per_page %>">« less</a>
|
6
|
+
<% end %>
|
7
|
+
<% if start + per_page < total_size %>
|
8
|
+
<a class="more" href="<%= current_page %><%= divider %>start=<%= start + per_page %>">more »</a>
|
9
|
+
<% end %>
|
10
|
+
</p>
|
11
|
+
<% end %>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
<div class="col-xs-6">
|
2
|
+
<h2 class="sub-header">Overview</h2>
|
3
|
+
<div class="table-responsive">
|
4
|
+
<p class="text-info">
|
5
|
+
The list below shows an overview of the jobs in the delayed_job queue.
|
6
|
+
</p>
|
7
|
+
<table class="overview table table-striped table-hover">
|
8
|
+
<tr>
|
9
|
+
<th>Status</th>
|
10
|
+
<th>Count</th>
|
11
|
+
</tr>
|
12
|
+
<tr>
|
13
|
+
<td class="status">
|
14
|
+
<a href="<%= u('/enqueued') %>">Enqueued Jobs</a>
|
15
|
+
</td>
|
16
|
+
<td class="status">
|
17
|
+
<%= delayed_jobs(:enqueued, @queues).count %>
|
18
|
+
</td>
|
19
|
+
</tr>
|
20
|
+
<tr>
|
21
|
+
<td class="status success">
|
22
|
+
<a href="<%= u('/working') %>">Working Jobs</a>
|
23
|
+
</td>
|
24
|
+
<td class="status success">
|
25
|
+
<%= delayed_jobs(:working, @queues).count %>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
<tr>
|
29
|
+
<td class="status warning">
|
30
|
+
<a href="<%= u('/pending') %>">Pending Jobs</a>
|
31
|
+
</td>
|
32
|
+
<td class="status warning">
|
33
|
+
<%= delayed_jobs(:pending, @queues).count %>
|
34
|
+
</td>
|
35
|
+
</tr>
|
36
|
+
<tr class="<%= delayed_jobs(:failed, @queues).count > 0 ? 'failure' : '' %>">
|
37
|
+
<td class="status danger">
|
38
|
+
<a href="<%= u('/failed') %>">Failed Jobs</a>
|
39
|
+
</td>
|
40
|
+
<td class="status danger">
|
41
|
+
<%= delayed_jobs(:failed, @queues).count %>
|
42
|
+
</td>
|
43
|
+
</tr>
|
44
|
+
</table>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
<!-- Stats -->
|
48
|
+
<div class="col-xs-6">
|
49
|
+
<h2 class="sub-header">Statistics</h2>
|
50
|
+
<div class="table-responsive">
|
51
|
+
<p class="text-info">
|
52
|
+
The list below shows an overview of the jobs in the delayed_job queue.
|
53
|
+
</p>
|
54
|
+
<table class="stats table table-striped table-hover">
|
55
|
+
<tr>
|
56
|
+
<th class="status">
|
57
|
+
Environment
|
58
|
+
</th>
|
59
|
+
<th>
|
60
|
+
<%=h Sinatra::Application.environment.to_s %>
|
61
|
+
</th>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<th class="status">
|
65
|
+
Total Failed
|
66
|
+
</th>
|
67
|
+
<th>
|
68
|
+
<%= delayed_jobs(:failed, @queues).count %>
|
69
|
+
</th>
|
70
|
+
</tr>
|
71
|
+
<tr>
|
72
|
+
<th class="status">
|
73
|
+
Total Pending
|
74
|
+
</th>
|
75
|
+
<th>
|
76
|
+
<%= delayed_jobs(:pending, @queues).count %>
|
77
|
+
</th>
|
78
|
+
</tr>
|
79
|
+
<tr>
|
80
|
+
<th class="status">
|
81
|
+
Currently Working
|
82
|
+
</th>
|
83
|
+
<th>
|
84
|
+
<%= delayed_jobs(:working, @queues).count %>
|
85
|
+
</th>
|
86
|
+
</tr>
|
87
|
+
</table>
|
88
|
+
</div>
|
89
|
+
<%= poll %>
|
90
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<h2 class="sub-header">Pending</h2>
|
2
|
+
<p class="text-info">
|
3
|
+
The list below shows an overview of the jobs that are pending.
|
4
|
+
</p>
|
5
|
+
<% if @jobs.any? %>
|
6
|
+
<form action="<%= u('requeue/all') %>" method="POST">
|
7
|
+
<%= csrf_token_tag %>
|
8
|
+
<input type="submit" value="Enqueue All Immediately"></input>
|
9
|
+
</form>
|
10
|
+
<% end %>
|
11
|
+
<p class="sub">
|
12
|
+
The list below contains jobs currently being processed.
|
13
|
+
</p>
|
14
|
+
<p class="sub">
|
15
|
+
<%= "Showing #{start} to #{start + per_page} of #{@all_jobs.count} pending jobs." %>
|
16
|
+
</p>
|
17
|
+
<ul class="job">
|
18
|
+
<% @jobs.each do |job| %>
|
19
|
+
<%= partial :job, {:job => job} %>
|
20
|
+
<% end %>
|
21
|
+
</ul>
|
22
|
+
<%= partial :next_more, :start => start, :total_size => @all_jobs.count, :per_page => per_page %>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="page-header">
|
2
|
+
<h2>Stats</h2>
|
3
|
+
</div>
|
4
|
+
<table class="stats">
|
5
|
+
<tr>
|
6
|
+
<th class="status">
|
7
|
+
environment
|
8
|
+
</th>
|
9
|
+
<th>
|
10
|
+
<%=h Sinatra::Application.environment.to_s %>
|
11
|
+
</th>
|
12
|
+
</tr>
|
13
|
+
<tr>
|
14
|
+
<th class="status">
|
15
|
+
failed
|
16
|
+
</th>
|
17
|
+
<th>
|
18
|
+
<%= delayed_jobs(:failed, @queues).count %>
|
19
|
+
</th>
|
20
|
+
</tr>
|
21
|
+
<tr>
|
22
|
+
<th class="status">
|
23
|
+
pending
|
24
|
+
</th>
|
25
|
+
<th>
|
26
|
+
<%= delayed_jobs(:pending, @queues).count %>
|
27
|
+
</th>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<th class="status">
|
31
|
+
working
|
32
|
+
</th>
|
33
|
+
<th>
|
34
|
+
<%= delayed_jobs(:working, @queues).count %>
|
35
|
+
</th>
|
36
|
+
</tr>
|
37
|
+
</table>
|
38
|
+
<%= poll %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2 class="sub-header">Processing</h2>
|
2
|
+
<p class="text-info">
|
3
|
+
The list below shows an overview of the jobs that are currently being processed.
|
4
|
+
</p>
|
5
|
+
<p class="sub">
|
6
|
+
The list below contains jobs currently being processed.
|
7
|
+
</p>
|
8
|
+
<p class="sub">
|
9
|
+
<%= "Showing #{start} to #{start + per_page} of #{@all_jobs.count} working jobs." %>
|
10
|
+
</p>
|
11
|
+
<ul class="list-group">
|
12
|
+
<% @jobs.each do |job| %>
|
13
|
+
<%= partial :job, {:job => job} %>
|
14
|
+
<% end %>
|
15
|
+
</ul>
|
16
|
+
<%= partial :next_more, :start => start, :total_size => @all_jobs.count, :per_page => per_page %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Sinatra will automatically use Rails sessions if mounted within a Rails app.
|
2
|
+
#
|
3
|
+
# If you enable sessions in a Sinatra app, and then mount it in a Rails 4 app,
|
4
|
+
# Rack::Session will blow up because ActionDispatch::Request::Session does not
|
5
|
+
# implement #each.
|
6
|
+
|
7
|
+
DelayedJobWeb.disable :sessions
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'support/rails_app'
|
3
|
+
require 'support/delayed_job_fake'
|
4
|
+
|
5
|
+
class TestMountedInRailsApp < MiniTest::Unit::TestCase
|
6
|
+
include Rack::Test::Methods
|
7
|
+
|
8
|
+
def app
|
9
|
+
RailsApp
|
10
|
+
end
|
11
|
+
|
12
|
+
# basic smoke test all the tabs
|
13
|
+
%w(overview enqueued working pending failed stats).each do |tab|
|
14
|
+
define_method :"test_#{tab}" do
|
15
|
+
get "/delayed_job/#{tab}"
|
16
|
+
assert last_response.ok?, "Received bad response: #{last_response.inspect}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|