mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Polish job tags with Sidekiq Pro filtering support
This commit is contained in:
parent
c428383523
commit
7864fdbeb3
9 changed files with 31 additions and 24 deletions
11
Changes.md
11
Changes.md
|
@ -5,14 +5,15 @@
|
|||
HEAD
|
||||
---------
|
||||
|
||||
- Support ad-hoc job tags. You can tag your jobs with, for example, subdomain, tenant, country, locale, application,
|
||||
version, user/client, "alpha/beta/pro/ent", types of jobs, teams/people responsible for jobs,
|
||||
additional metadata, etc.
|
||||
Tags are shown on different pages with job listings [fatkodima, #4280]
|
||||
- Support ad-hoc job tags. You can tag your jobs with, e.g, subdomain, tenant, country,
|
||||
locale, application, version, user/client, "alpha/beta/pro/ent", types of jobs,
|
||||
teams/people responsible for jobs, additional metadata, etc.
|
||||
Tags are shown on different pages with job listings. Sidekiq Pro users
|
||||
can filter based on them [fatkodima, #4280]
|
||||
```ruby
|
||||
class MyWorker
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options tags: ['foo', 'bar']
|
||||
sidekiq_options tags: ['bank-ops', 'alpha']
|
||||
...
|
||||
end
|
||||
```
|
||||
|
|
|
@ -115,6 +115,12 @@ module Sidekiq
|
|||
end
|
||||
end
|
||||
|
||||
def display_tags(job)
|
||||
job.tags.map { |tag|
|
||||
"<span class='jobtag label label-info'>#{::Rack::Utils.escape_html(tag)}</span>"
|
||||
}.join(" ")
|
||||
end
|
||||
|
||||
# mperham/sidekiq#3243
|
||||
def unfiltered?
|
||||
yield unless env["PATH_INFO"].start_with?("/filter/")
|
||||
|
|
|
@ -201,6 +201,15 @@ td form {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
.jobtag a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.jobtag a:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
table .table-checkbox label {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
|
|
@ -14,12 +14,8 @@
|
|||
<tr>
|
||||
<th><%= t('Job') %></th>
|
||||
<td>
|
||||
<code>
|
||||
<%= job.display_class %>
|
||||
<% job.tags.each do |tag| %>
|
||||
<span class="label label-info"><%= tag %></span>
|
||||
<% end %>
|
||||
</code>
|
||||
<%= job.display_class %>
|
||||
<%= display_tags(job) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -89,9 +89,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<%= job.display_class %>
|
||||
<% job.tags.each do |tag| %>
|
||||
<span class="label label-info"><%= tag %></span>
|
||||
<% end %>
|
||||
<%= display_tags(job, nil) %>
|
||||
</td>
|
||||
<td>
|
||||
<div class="args"><%= display_args(job.display_args) %></div>
|
||||
|
|
|
@ -44,9 +44,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<%= entry.display_class %>
|
||||
<% entry.tags.each do |tag| %>
|
||||
<span class="label label-info"><%= tag %></span>
|
||||
<% end %>
|
||||
<%= display_tags(entry, "morgue") %>
|
||||
</td>
|
||||
<td>
|
||||
<div class="args"><%= display_args(entry.display_args) %></div>
|
||||
|
|
|
@ -29,9 +29,7 @@
|
|||
<% end %>
|
||||
<td>
|
||||
<%= h(msg.display_class) %>
|
||||
<% msg.tags.each do |tag| %>
|
||||
<span class="label label-info"><%= tag %></span>
|
||||
<% end %>
|
||||
<%= display_tags(msg, nil) %>
|
||||
</td>
|
||||
<td>
|
||||
<% a = msg.display_args %>
|
||||
|
|
|
@ -44,7 +44,10 @@
|
|||
<td>
|
||||
<a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
|
||||
</td>
|
||||
<td><%= entry.display_class %></td>
|
||||
<td>
|
||||
<%= entry.display_class %>
|
||||
<%= display_tags(entry, "retries") %>
|
||||
</td>
|
||||
<td>
|
||||
<div class="args"><%= display_args(entry.display_args) %></div>
|
||||
</td>
|
||||
|
|
|
@ -40,9 +40,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<%= entry.display_class %>
|
||||
<% entry.tags.each do |tag| %>
|
||||
<span class="label label-info"><%= tag %></span>
|
||||
<% end %>
|
||||
<%= display_tags(entry, "scheduled") %>
|
||||
</td>
|
||||
<td>
|
||||
<div class="args"><%= display_args(entry.display_args) %></div>
|
||||
|
|
Loading…
Add table
Reference in a new issue