sidekiq-status 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/lib/sidekiq-status/version.rb +1 -1
- data/lib/sidekiq-status/web.rb +5 -1
- data/spec/lib/sidekiq-status/web_spec.rb +21 -0
- data/web/views/statuses.erb +10 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91dc4d7b8b58f85f9f04ea9a2346b64999f453fe186f9dcbaa915bdfa7432920
|
4
|
+
data.tar.gz: f08db1e8246645be8783ac1e8a8fba46cc9e1777ee2049b7bc256ec07ee34454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33943d5d8e663ba5ef5c58c692137f5e4cb8977ef15cab4862183cf2a473743da00c4f05837ef3b2e073c7c04c9a4e085ac561ab396c2269f59392bb90328edf
|
7
|
+
data.tar.gz: 73a30ec1c4baafa8e28c45c04cabcc08f8612889a2398f9b7706bbf19b3e204e82d7aef73e1b9cbe91b5c562018ce2ab29bb5738425ad3ebb910f4b8fe62485c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
**Version 1.1.3**
|
2
|
+
* Adds a job status filter to the UI (#149)
|
3
|
+
|
1
4
|
**Version 1.1.2**
|
2
|
-
* Job detail pages now show custom data keys (#
|
5
|
+
* Job detail pages now show custom data keys (#146)
|
3
6
|
|
4
7
|
**Version 1.1.1**
|
5
8
|
* Uses SCAN rather than KEYS when retrieving job ids from Redis (#139)
|
data/lib/sidekiq-status/web.rb
CHANGED
@@ -105,6 +105,10 @@ module Sidekiq::Status
|
|
105
105
|
@statuses = @statuses.sort { |y,x| (x[sort_by] <=> y[sort_by]) || 1 }
|
106
106
|
end
|
107
107
|
|
108
|
+
if params[:status] && params[:status] != "all"
|
109
|
+
@statuses = @statuses.select {|job_status| job_status["status"] == params[:status] }
|
110
|
+
end
|
111
|
+
|
108
112
|
# Sidekiq pagination
|
109
113
|
@total_size = @statuses.count
|
110
114
|
@count = params[:per_page] ? params[:per_page].to_i : Sidekiq::Status::Web.default_per_page
|
@@ -158,7 +162,7 @@ end
|
|
158
162
|
|
159
163
|
require 'sidekiq/web' unless defined?(Sidekiq::Web)
|
160
164
|
Sidekiq::Web.register(Sidekiq::Status::Web)
|
161
|
-
["per_page", "sort_by", "sort_dir"].each do |key|
|
165
|
+
["per_page", "sort_by", "sort_dir", "status"].each do |key|
|
162
166
|
Sidekiq::WebHelpers::SAFE_QPARAMS.push(key)
|
163
167
|
end
|
164
168
|
if Sidekiq::Web.tabs.is_a?(Array)
|
@@ -31,6 +31,27 @@ describe 'sidekiq status web' do
|
|
31
31
|
expect(last_response.body).to match(/working/)
|
32
32
|
end
|
33
33
|
|
34
|
+
it 'allows filtering the list of jobs by status' do
|
35
|
+
capture_status_updates(2) do
|
36
|
+
LongJob.perform_async(0.5)
|
37
|
+
end
|
38
|
+
|
39
|
+
get '/statuses?status=working'
|
40
|
+
expect(last_response).to be_ok
|
41
|
+
expect(last_response.body).to match(/#{job_id}/)
|
42
|
+
expect(last_response.body).to match(/LongJob/)
|
43
|
+
expect(last_response.body).to match(/working/)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'allows filtering the list of jobs by completed status' do
|
47
|
+
capture_status_updates(2) do
|
48
|
+
LongJob.perform_async(0.5)
|
49
|
+
end
|
50
|
+
get '/statuses?status=completed'
|
51
|
+
expect(last_response).to be_ok
|
52
|
+
expect(last_response.body).to_not match(/LongJob/)
|
53
|
+
end
|
54
|
+
|
34
55
|
it 'shows a single job in progress' do
|
35
56
|
capture_status_updates(2) do
|
36
57
|
LongJob.perform_async(1, 'another argument')
|
data/web/views/statuses.erb
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
display: flex;
|
39
39
|
align-items: center;
|
40
40
|
}
|
41
|
-
.nav-container .per-page {
|
41
|
+
.nav-container .per-page, .filter-status {
|
42
42
|
display: flex;
|
43
43
|
align-items: center;
|
44
44
|
margin: 20px 0 20px 10px;
|
@@ -57,6 +57,15 @@ function setPerPage(select){
|
|
57
57
|
<h3 class="wi">Recent job statuses</h3>
|
58
58
|
<div class="nav-container">
|
59
59
|
<%= erb :_paging, locals: { url: "#{root_path}statuses" } %>
|
60
|
+
<div class="filter-status">
|
61
|
+
Filter Status:
|
62
|
+
<select class="form-control" onchange="setPerPage(this)">
|
63
|
+
<% (['all', 'complete', 'failed', 'interrupted', 'queued', 'retrying', 'stopped', 'working']).each do |status| %>
|
64
|
+
<option data-url="?<%= qparams(status: status)%>" value="<%= status %>" <%= 'selected="selected"' if status == (params[:status]) %>><%= status %></option>
|
65
|
+
<% end %>
|
66
|
+
</select>
|
67
|
+
</div>
|
68
|
+
|
60
69
|
<div class="per-page">
|
61
70
|
Per page:
|
62
71
|
<select class="form-control" onchange="setPerPage(this)">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Tsvigun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-05-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
|
-
rubygems_version: 3.0.
|
190
|
+
rubygems_version: 3.0.3
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: An extension to the sidekiq message processing to track your jobs
|