sidekiq-status 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 328bd95affe0aa84cd7c797f63ba97b3d93a7d60fa003d75ede0e9996b88c399
4
- data.tar.gz: db96de58b9b6e45f5ec0ecc600839778b82c4956ce43de7af55fafe42478af10
3
+ metadata.gz: 91dc4d7b8b58f85f9f04ea9a2346b64999f453fe186f9dcbaa915bdfa7432920
4
+ data.tar.gz: f08db1e8246645be8783ac1e8a8fba46cc9e1777ee2049b7bc256ec07ee34454
5
5
  SHA512:
6
- metadata.gz: 8bfe5b5a0f8566f64d3778dff4f4a923103da2fb0926c4a43eb7677b689d3898641c2c0d53438cd88f8f72c1bd6bfa1e6db60326fed08cb953ede14ec7bc43d3
7
- data.tar.gz: ba8f04547ff36c3c77c6cffd75f92f908afb7dd13291eaf454838a48d5a19014d6fb8e8a3fe663f6802e496e2a60588c64e477bbda97a504dd8936f8a0c37d7a
6
+ metadata.gz: 33943d5d8e663ba5ef5c58c692137f5e4cb8977ef15cab4862183cf2a473743da00c4f05837ef3b2e073c7c04c9a4e085ac561ab396c2269f59392bb90328edf
7
+ data.tar.gz: 73a30ec1c4baafa8e28c45c04cabcc08f8612889a2398f9b7706bbf19b3e204e82d7aef73e1b9cbe91b5c562018ce2ab29bb5738425ad3ebb910f4b8fe62485c
@@ -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 (#139)
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)
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Status
3
- VERSION = '1.1.2'
3
+ VERSION = '1.1.3'
4
4
  end
5
5
  end
@@ -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')
@@ -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.2
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-03-20 00:00:00.000000000 Z
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.1
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