resque-job_history 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque/job_history_server.rb +13 -0
- data/lib/resque/plugins/job_history/cleaner.rb +15 -0
- data/lib/resque/plugins/job_history/job.rb +2 -0
- data/lib/resque/plugins/job_history/job_list.rb +19 -4
- data/lib/resque/plugins/version.rb +1 -1
- data/lib/resque/server/views/_job_class_pagination.erb +20 -20
- data/lib/resque/server/views/_job_pagination.erb +30 -25
- data/lib/resque/server/views/_jobs_list.erb +2 -1
- data/lib/resque/server/views/_linear_pagination.erb +15 -10
- data/lib/resque/server/views/job_class_details.erb +10 -2
- data/lib/resque/server/views/job_details.erb +8 -5
- data/lib/resque/server/views/job_history.erb +53 -45
- data/lib/resque/server/views/linear_history.erb +12 -3
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 611450a862256e5adff163fdc1932b60ccb780af
|
4
|
+
data.tar.gz: 1873bbabe72e49820c3d43697fac5940840de034
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d38f13b928d53a355148ad45e53cbf2205589ed8078b50220d40aac6aa29045369279880a5da339dde7820b3c32edf1aeb266c5788e158cee1229f0133b79da5
|
7
|
+
data.tar.gz: d0527dca6d0b41b1e9126dda7f27ef61b92d26b62f67884b5453cee72b93c80be2547c16d717235312737872e9e06852a5b1c0435b54236a9656e6d588fb869a
|
@@ -3,6 +3,8 @@
|
|
3
3
|
require "resque"
|
4
4
|
require "resque/server"
|
5
5
|
require "resque-job_history"
|
6
|
+
require "action_view/helpers/output_safety_helper"
|
7
|
+
require "action_view/helpers/capture_helper"
|
6
8
|
require "action_view/helpers/date_helper"
|
7
9
|
|
8
10
|
module Resque
|
@@ -136,6 +138,7 @@ module Resque
|
|
136
138
|
|
137
139
|
def add_button_callbacks(base)
|
138
140
|
purge_all(base)
|
141
|
+
purge_linear_history(base)
|
139
142
|
purge_class(base)
|
140
143
|
retry_job(base)
|
141
144
|
delete_job(base)
|
@@ -192,6 +195,16 @@ module Resque
|
|
192
195
|
end
|
193
196
|
end
|
194
197
|
end
|
198
|
+
|
199
|
+
def purge_linear_history(base)
|
200
|
+
base.class_eval do
|
201
|
+
post "/job history/purge_linear_history" do
|
202
|
+
Resque::Plugins::JobHistory::Cleaner.purge_linear_history
|
203
|
+
|
204
|
+
redirect u("job history")
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
195
208
|
end
|
196
209
|
|
197
210
|
Resque::Server.tabs << "Job History"
|
@@ -55,6 +55,21 @@ module Resque
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
def purge_linear_history
|
59
|
+
linear_jobs = Resque::Plugins::JobHistory::JobList.new.linear_jobs
|
60
|
+
|
61
|
+
fixup_linear_keys
|
62
|
+
|
63
|
+
linear_jobs.job_ids.each do |job_id|
|
64
|
+
linear_jobs.remove_job(job_id)
|
65
|
+
end
|
66
|
+
|
67
|
+
list_keys = redis.keys("job_history..*")
|
68
|
+
list_keys.each do |key|
|
69
|
+
del_key(key, "Purging unknown linear history key")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
58
73
|
def purge_invalid_jobs
|
59
74
|
job_classes.each do |class_name|
|
60
75
|
next if Resque::Plugins::JobHistory::HistoryDetails.new(class_name).class_name_valid?
|
@@ -56,8 +56,11 @@ module Resque
|
|
56
56
|
:num_finished_jobs,
|
57
57
|
:total_finished_jobs,
|
58
58
|
:total_run_jobs,
|
59
|
-
:max_concurrent_jobs
|
59
|
+
:max_concurrent_jobs,
|
60
|
+
:total_failed_jobs
|
60
61
|
job_details.public_send sort_key
|
62
|
+
when :class_name_valid?
|
63
|
+
job_details.class_name_valid? ? 1 : 0
|
61
64
|
else
|
62
65
|
last_run_sort_value(job_details.last_run, sort_key)
|
63
66
|
end
|
@@ -66,13 +69,25 @@ module Resque
|
|
66
69
|
def last_run_sort_value(last_run, sort_key)
|
67
70
|
case sort_key.to_sym
|
68
71
|
when :start_time
|
69
|
-
last_run
|
72
|
+
last_run_start_time_sort(last_run)
|
70
73
|
when :duration
|
71
|
-
last_run
|
74
|
+
last_run_duration_sort(last_run)
|
72
75
|
when :success
|
73
|
-
last_run
|
76
|
+
last_run_succeeded_sort(last_run)
|
74
77
|
end
|
75
78
|
end
|
79
|
+
|
80
|
+
def last_run_succeeded_sort(last_run)
|
81
|
+
last_run.try(:succeeded?) ? 1 : 0
|
82
|
+
end
|
83
|
+
|
84
|
+
def last_run_duration_sort(last_run)
|
85
|
+
last_run.try(:duration) || 100.years
|
86
|
+
end
|
87
|
+
|
88
|
+
def last_run_start_time_sort(last_run)
|
89
|
+
last_run.try(:start_time) || Time.now
|
90
|
+
end
|
76
91
|
end
|
77
92
|
end
|
78
93
|
end
|
@@ -9,19 +9,19 @@
|
|
9
9
|
|
10
10
|
<% if total_pages > 1 %>
|
11
11
|
<div class="job_history_prev_links">
|
12
|
-
<a href="job
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
<a href="<%= u("job history") %>?<%= { sort: @sort_by,
|
13
|
+
page_size: page_size,
|
14
|
+
page_num: 1,
|
15
|
+
order: @sort_order }.to_param %>"
|
16
16
|
class="job_history_first_page"
|
17
17
|
disabled="<%= first_page > 1 %>">
|
18
18
|
<< First
|
19
19
|
</a>
|
20
20
|
|
21
|
-
<a href="job
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
<a href="<%= u("job history") %>?<%= { sort: @sort_by,
|
22
|
+
page_size: page_size,
|
23
|
+
page_num: [1, page_num - 1].max,
|
24
|
+
order: @sort_order }.to_param %>"
|
25
25
|
class="job_history_prev_page"
|
26
26
|
disabled="<%= page_num > 1 %>">
|
27
27
|
< Prev
|
@@ -31,10 +31,10 @@
|
|
31
31
|
<div class="job_history_pages">
|
32
32
|
<% (first_page..last_page).each do |page_number| %>
|
33
33
|
<% if page_number != page_num %>
|
34
|
-
<a href="job
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
<a href="<%= u("job history") %>?<%= { sort: @sort_by,
|
35
|
+
page_size: page_size,
|
36
|
+
page_num: page_number,
|
37
|
+
order: @sort_order }.to_param %>"
|
38
38
|
class="job_history_page">
|
39
39
|
<%= page_number %>
|
40
40
|
</a>
|
@@ -45,19 +45,19 @@
|
|
45
45
|
</div>
|
46
46
|
|
47
47
|
<div class="job_history_next_links">
|
48
|
-
<a href="job
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
<a href="<%= u("job history") %>?<%= { sort: @sort_by,
|
49
|
+
page_size: page_size,
|
50
|
+
page_num: [total_pages, page_num + 1].min,
|
51
|
+
order: @sort_order }.to_param %>"
|
52
52
|
class="job_history_next_page"
|
53
53
|
disabled="<%= page_num < last_page %>">
|
54
54
|
Next >
|
55
55
|
</a>
|
56
56
|
|
57
|
-
<a href="job
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
<a href="<%= u("job history") %>?<%= { sort: @sort_by,
|
58
|
+
page_size: page_size,
|
59
|
+
page_num: total_pages,
|
60
|
+
order: @sort_order }.to_param %>"
|
61
61
|
class="job_history_last_page"
|
62
62
|
disabled="<%= last_page < total_pages %>">
|
63
63
|
Last >>
|
@@ -9,21 +9,23 @@
|
|
9
9
|
|
10
10
|
<% if total_pages > 1 %>
|
11
11
|
<div class="job_history_prev_links">
|
12
|
-
<a href="job_class_details
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
<a href="<%= u("job history/job_class_details") %>?<%=
|
13
|
+
{ class_name: class_name,
|
14
|
+
"#{primary_type}_page_size" => page_size,
|
15
|
+
"#{primary_type}_page_num" => 1,
|
16
|
+
"#{secondary_type}_page_size" => secondary_page_size,
|
17
|
+
"#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
|
17
18
|
class="job_history_first_page"
|
18
19
|
disabled="<%= first_page > 1 %>">
|
19
20
|
<< First
|
20
21
|
</a>
|
21
22
|
|
22
|
-
<a href="job_class_details
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
<a href="<%= u("job history/job_class_details") %>?<%=
|
24
|
+
{ class_name: class_name,
|
25
|
+
"#{primary_type}_page_size" => page_size,
|
26
|
+
"#{primary_type}_page_num" => [1, page_num - 1].max,
|
27
|
+
"#{secondary_type}_page_size" => secondary_page_size,
|
28
|
+
"#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
|
27
29
|
class="job_history_prev_page"
|
28
30
|
disabled="<%= page_num > 1 %>">
|
29
31
|
< Prev
|
@@ -33,11 +35,12 @@
|
|
33
35
|
<div class="job_history_pages">
|
34
36
|
<% (first_page..last_page).each do |page_number| %>
|
35
37
|
<% if page_number != page_num %>
|
36
|
-
<a href="job_class_details
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
<a href="<%= u("job history/job_class_details") %>?<%=
|
39
|
+
{ class_name: class_name,
|
40
|
+
"#{primary_type}_page_size" => page_size,
|
41
|
+
"#{primary_type}_page_num" => page_number,
|
42
|
+
"#{secondary_type}_page_size" => secondary_page_size,
|
43
|
+
"#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
|
41
44
|
class="job_history_page">
|
42
45
|
<%= page_number %>
|
43
46
|
</a>
|
@@ -48,21 +51,23 @@
|
|
48
51
|
</div>
|
49
52
|
|
50
53
|
<div class="job_history_next_links">
|
51
|
-
<a href="job_class_details
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
<a href="<%= u("job history/job_class_details") %>?<%=
|
55
|
+
{ class_name: class_name,
|
56
|
+
"#{primary_type}_page_size" => page_size,
|
57
|
+
"#{primary_type}_page_num" => [total_pages, page_num + 1].min,
|
58
|
+
"#{secondary_type}_page_size" => secondary_page_size,
|
59
|
+
"#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
|
56
60
|
class="job_history_next_page"
|
57
61
|
disabled="<%= page_num < last_page %>">
|
58
62
|
Next >
|
59
63
|
</a>
|
60
64
|
|
61
|
-
<a href="job_class_details
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
65
|
+
<a href="<%= u("job history/job_class_details") %>?<%=
|
66
|
+
{ class_name: class_name,
|
67
|
+
"#{primary_type}_page_size" => page_size,
|
68
|
+
"#{primary_type}_page_num" => total_pages,
|
69
|
+
"#{secondary_type}_page_size" => secondary_page_size,
|
70
|
+
"#{secondary_type}_page_num" => secondary_page_num }.to_param %>"
|
66
71
|
class="job_history_last_page"
|
67
72
|
disabled="<%= last_page < total_pages %>">
|
68
73
|
Last >>
|
@@ -23,7 +23,8 @@
|
|
23
23
|
<% jobs.each do |job_details| %>
|
24
24
|
<tr<%= job_details.succeeded? ? "" : " class=\"job_history_error\"" %>>
|
25
25
|
<td>
|
26
|
-
<a href="job_details
|
26
|
+
<a href="<%= u("job history/job_details") %>?class_name=<%=
|
27
|
+
job_details.class_name %>&job_id=<%= job_details.job_id %>">
|
27
28
|
<% if job_details.start_time %>
|
28
29
|
<%= time_ago_in_words(job_details.start_time) %> ago
|
29
30
|
(<%= job_details.start_time %>)
|
@@ -9,15 +9,17 @@
|
|
9
9
|
|
10
10
|
<% if total_pages > 1 %>
|
11
11
|
<div class="job_history_prev_links">
|
12
|
-
<a href="
|
13
|
-
|
12
|
+
<a href="<%= u("job history/linear_history") %>?<%=
|
13
|
+
{ "page_size" => page_size,
|
14
|
+
"page_num" => 1 }.to_param %>"
|
14
15
|
class="job_history_first_page"
|
15
16
|
disabled="<%= first_page > 1 %>">
|
16
17
|
<< First
|
17
18
|
</a>
|
18
19
|
|
19
|
-
<a href="
|
20
|
-
|
20
|
+
<a href="<%= u("job history/linear_history") %>?<%=
|
21
|
+
{ "page_size" => page_size,
|
22
|
+
"page_num" => [1, page_num - 1].max }.to_param %>"
|
21
23
|
class="job_history_prev_page"
|
22
24
|
disabled="<%= page_num > 1 %>">
|
23
25
|
< Prev
|
@@ -27,8 +29,9 @@
|
|
27
29
|
<div class="job_history_pages">
|
28
30
|
<% (first_page..last_page).each do |page_number| %>
|
29
31
|
<% if page_number != page_num %>
|
30
|
-
<a href="
|
31
|
-
|
32
|
+
<a href="<%= u("job history/linear_history") %>?<%=
|
33
|
+
{ "page_size" => page_size,
|
34
|
+
"page_num" => page_number }.to_param %>"
|
32
35
|
class="job_history_page">
|
33
36
|
<%= page_number %>
|
34
37
|
</a>
|
@@ -39,15 +42,17 @@
|
|
39
42
|
</div>
|
40
43
|
|
41
44
|
<div class="job_history_next_links">
|
42
|
-
<a href="
|
43
|
-
|
45
|
+
<a href="<%= u("job history/linear_history") %>?<%=
|
46
|
+
{ "page_size" => page_size,
|
47
|
+
"page_num" => [total_pages, page_num + 1].min }.to_param %>"
|
44
48
|
class="job_history_next_page"
|
45
49
|
disabled="<%= page_num < last_page %>">
|
46
50
|
Next >
|
47
51
|
</a>
|
48
52
|
|
49
|
-
<a href="
|
50
|
-
|
53
|
+
<a href="<%= u("job history/linear_history") %>?<%=
|
54
|
+
{ "page_size" => page_size,
|
55
|
+
"page_num" => total_pages }.to_param %>"
|
51
56
|
class="job_history_last_page"
|
52
57
|
disabled="<%= last_page < total_pages %>">
|
53
58
|
Last >>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
|
1
|
+
<link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
|
2
2
|
|
3
3
|
<h1><%= @job_class_name %></h1>
|
4
4
|
|
@@ -38,6 +38,14 @@
|
|
38
38
|
<%= class_info.total_finished_jobs.to_i %>
|
39
39
|
</td>
|
40
40
|
</tr>
|
41
|
+
<tr>
|
42
|
+
<td>
|
43
|
+
Total jobs failed
|
44
|
+
</td>
|
45
|
+
<td>
|
46
|
+
<%= class_info.total_failed_jobs.to_i %>
|
47
|
+
</td>
|
48
|
+
</tr>
|
41
49
|
<tr>
|
42
50
|
<td>
|
43
51
|
Total jobs in history
|
@@ -101,7 +109,7 @@
|
|
101
109
|
This class cannot be purged because of another class with a similar name. The other class must
|
102
110
|
be purged before this one can be safely purged.
|
103
111
|
<% else %>
|
104
|
-
<form method="POST" action="purge_class
|
112
|
+
<form method="POST" action="<%= u("job history/purge_class") %>?<%= { class_name: @job_class_name }.to_param %>">
|
105
113
|
<input type="submit" name="" value="Purge all histories for <%= @job_class_name %>"/>
|
106
114
|
</form>
|
107
115
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
|
1
|
+
<link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
|
2
2
|
|
3
3
|
<h1>
|
4
4
|
<%= @job_class_name %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
Job History
|
12
12
|
</a>
|
13
13
|
|
|
14
|
-
<a href="job_class_details
|
14
|
+
<a href="<%= u("job history/job_class_details") %>?<%= { class_name: @job_class_name }.to_param %>">
|
15
15
|
<%= @job_class_name %>
|
16
16
|
</a>
|
17
17
|
</p>
|
@@ -68,17 +68,20 @@
|
|
68
68
|
<br/>
|
69
69
|
|
70
70
|
<% unless job_details.finished? %>
|
71
|
-
<form method="POST" action="
|
71
|
+
<form method="POST" action="<%= u("job history/cancel_job") %>?<%=
|
72
|
+
{ class_name: @job_class_name, job_id: @job_id }.to_param %>">
|
72
73
|
<input type="submit" name="" value="Job is not running - Cancel job"/>
|
73
74
|
</form>
|
74
75
|
<% end %>
|
75
76
|
|
76
|
-
<form method="POST" action="
|
77
|
+
<form method="POST" action="<%= u("job history/delete_job") %>?<%=
|
78
|
+
{ class_name: @job_class_name, job_id: @job_id }.to_param %>">
|
77
79
|
<input type="submit" name="" value="Delete this run"/>
|
78
80
|
</form>
|
79
81
|
|
80
82
|
<% if Resque::Plugins::JobHistory::HistoryDetails.new(@job_class_name).class_name_valid?() %>
|
81
|
-
<form method="POST" action="
|
83
|
+
<form method="POST" action="<%= u("job history/retry_job") %>?<%=
|
84
|
+
{ class_name: @job_class_name, job_id: @job_id }.to_param %>">
|
82
85
|
<input type="submit" name="" value="Retry this run"/>
|
83
86
|
</form>
|
84
87
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
|
1
|
+
<link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
|
2
2
|
|
3
3
|
<h1>Job Classes</h1>
|
4
4
|
|
@@ -16,60 +16,68 @@
|
|
16
16
|
<div class="table_container">
|
17
17
|
<table>
|
18
18
|
<tr>
|
19
|
-
<th><a href="job
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
<th><a href="<%= u("job history") %>?<%=
|
20
|
+
{ sort: "class_name",
|
21
|
+
page_size: @page_size,
|
22
|
+
page_num: @page_num,
|
23
|
+
order: job_list.
|
24
|
+
order_param("class_name", @sort_by, @sort_order) }.to_param %>">
|
24
25
|
Class name
|
25
26
|
</a></th>
|
26
|
-
<th><a href="job
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
<th><a href="<%= u("job history") %>?<%=
|
28
|
+
{ sort: "num_running_jobs",
|
29
|
+
page_size: @page_size,
|
30
|
+
page_num: @page_num,
|
31
|
+
order: job_list.
|
32
|
+
order_param("num_running_jobs", @sort_by, @sort_order) }.to_param %>">
|
31
33
|
Running
|
32
34
|
</a></th>
|
33
|
-
<th><a href="job
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
<th><a href="<%= u("job history") %>?<%=
|
36
|
+
{ sort: "total_run_jobs",
|
37
|
+
page_size: @page_size,
|
38
|
+
page_num: @page_num,
|
39
|
+
order: job_list.
|
40
|
+
order_param("total_run_jobs", @sort_by, @sort_order) }.to_param %>">
|
38
41
|
Total Run
|
39
42
|
</a></th>
|
40
|
-
<th><a href="job
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
<th><a href="<%= u("job history") %>?<%=
|
44
|
+
{ sort: "total_finished_jobs",
|
45
|
+
page_size: @page_size,
|
46
|
+
page_num: @page_num,
|
47
|
+
order: job_list.
|
48
|
+
order_param("total_finished_jobs", @sort_by, @sort_order) }.to_param %>">
|
45
49
|
Finished
|
46
50
|
</a></th>
|
47
|
-
<th><a href="job
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
<th><a href="<%= u("job history") %>?<%=
|
52
|
+
{ sort: "total_failed_jobs",
|
53
|
+
page_size: @page_size,
|
54
|
+
page_num: @page_num,
|
55
|
+
order: job_list.
|
56
|
+
order_param("total_failed_jobs", @sort_by, @sort_order) }.to_param %>">
|
57
|
+
Failed
|
53
58
|
</a></th>
|
54
|
-
<th><a href="job
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
+
<th><a href="<%= u("job history") %>?<%=
|
60
|
+
{ sort: "start_time",
|
61
|
+
page_size: @page_size,
|
62
|
+
page_num: @page_num,
|
63
|
+
order: job_list.
|
64
|
+
order_param("start_time", @sort_by, @sort_order) }.to_param %>">
|
59
65
|
Last Run Start
|
60
66
|
</a></th>
|
61
|
-
<th><a href="job
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
67
|
+
<th><a href="<%= u("job history") %>?<%=
|
68
|
+
{ sort: "duration",
|
69
|
+
page_size: @page_size,
|
70
|
+
page_num: @page_num,
|
71
|
+
order: job_list.
|
72
|
+
order_param("duration", @sort_by, @sort_order) }.to_param %>">
|
66
73
|
Last Run Duration
|
67
74
|
</a></th>
|
68
|
-
<th><a href="job
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
75
|
+
<th><a href="<%= u("job history") %>?<%=
|
76
|
+
{ sort: "success",
|
77
|
+
page_size: @page_size,
|
78
|
+
page_num: @page_num,
|
79
|
+
order: job_list.
|
80
|
+
order_param("success", @sort_by, @sort_order) }.to_param %>">
|
73
81
|
Last Run successful
|
74
82
|
</a></th>
|
75
83
|
</tr>
|
@@ -77,7 +85,7 @@
|
|
77
85
|
<% job_list.job_summaries(@sort_by, @sort_order, @page_num, @page_size).each do |class_info| %>
|
78
86
|
<tr<%= class_info.last_run && !class_info.last_run.succeeded? ? " class=\"job_history_error\"" : "" %>>
|
79
87
|
<td>
|
80
|
-
<a href="job
|
88
|
+
<a href="<%= u("job history") %>/job_class_details?class_name=<%= class_info.class_name %>">
|
81
89
|
<%= class_info.class_name %>
|
82
90
|
</a>
|
83
91
|
</td>
|
@@ -91,7 +99,7 @@
|
|
91
99
|
<%= class_info.total_finished_jobs.to_i %>
|
92
100
|
</td>
|
93
101
|
<td>
|
94
|
-
<%= class_info.
|
102
|
+
<%= class_info.total_failed_jobs.to_i %>
|
95
103
|
</td>
|
96
104
|
<td>
|
97
105
|
<% if class_info.last_run && class_info.last_run.start_time %>
|
@@ -127,7 +135,7 @@
|
|
127
135
|
<br/>
|
128
136
|
|
129
137
|
<div>
|
130
|
-
<form method="POST" action="job
|
138
|
+
<form method="POST" action="<%= u("job history/purge_all") %>">
|
131
139
|
<input type="submit" name="" value="Purge all histories"/>
|
132
140
|
</form>
|
133
141
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<link href="job_history/public/job_history.css" media="screen" rel="stylesheet" type="text/css">
|
1
|
+
<link href="<%= u("job_history/public/job_history.css") %>" media="screen" rel="stylesheet" type="text/css">
|
2
2
|
|
3
3
|
<h1>Linear History</h1>
|
4
4
|
|
@@ -29,7 +29,8 @@
|
|
29
29
|
<% jobs.each do |job_details| %>
|
30
30
|
<tr<%= job_details.succeeded? ? "" : " class=\"job_history_error\"" %>>
|
31
31
|
<td>
|
32
|
-
<a href="
|
32
|
+
<a href="<%= u("job history/job_details") %>?<%=
|
33
|
+
{ class_name: job_details.class_name, job_id: job_details.job_id }.to_param %>">
|
33
34
|
<%= job_details.class_name %>
|
34
35
|
</a>
|
35
36
|
</td>
|
@@ -42,7 +43,7 @@
|
|
42
43
|
<% end %>
|
43
44
|
</td>
|
44
45
|
<td>
|
45
|
-
|
46
|
+
<%= distance_of_time_in_words(job_details.start_time, (job_details.end_time || Time.now)) %>
|
46
47
|
<% if job_details.finished? %>
|
47
48
|
(<%= job_details.end_time %>)
|
48
49
|
<% end %>
|
@@ -63,3 +64,11 @@
|
|
63
64
|
page_num: @page_num,
|
64
65
|
page_size: @page_size }) %>
|
65
66
|
<% end %>
|
67
|
+
|
68
|
+
<br/>
|
69
|
+
|
70
|
+
<div>
|
71
|
+
<form method="POST" action="<%= u("job history/purge_linear_history") %>">
|
72
|
+
<input type="submit" name="" value="Purge linear histories"/>
|
73
|
+
</form>
|
74
|
+
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-job_history
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RealNobody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rack-test
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
description: Keeps a history of run jobs by job.
|
168
182
|
email:
|
169
183
|
- RealNobody1@cox.net
|