sidekiq-web_custom 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +109 -0
  3. data/.gitignore +18 -0
  4. data/.rspec +3 -0
  5. data/CHANGELOG.md +5 -0
  6. data/CODE_OF_CONDUCT.md +84 -0
  7. data/Dockerfile +18 -0
  8. data/Gemfile +14 -0
  9. data/Gemfile.lock +182 -0
  10. data/LICENSE.txt +21 -0
  11. data/Makefile +40 -0
  12. data/README.md +92 -0
  13. data/Rakefile +8 -0
  14. data/bin/all_workers +69 -0
  15. data/bin/bundle +114 -0
  16. data/bin/publish +40 -0
  17. data/bin/publish_git +38 -0
  18. data/bin/publish_ruby_gems +22 -0
  19. data/bin/rails +18 -0
  20. data/bin/sidekiq +29 -0
  21. data/bin/sidekiqmon +29 -0
  22. data/docker-compose.yml +43 -0
  23. data/dummy_rails/.rspec +4 -0
  24. data/dummy_rails/app/assets/config/manifest.js +0 -0
  25. data/dummy_rails/app/controllers/application_controller.rb +2 -0
  26. data/dummy_rails/app/helpers/application_helper.rb +2 -0
  27. data/dummy_rails/app/views/layouts/application.html.erb +15 -0
  28. data/dummy_rails/app/views/layouts/mailer.html.erb +13 -0
  29. data/dummy_rails/app/workers/exclude_hard_worker.rb +15 -0
  30. data/dummy_rails/app/workers/exclude_lazy_worker.rb +11 -0
  31. data/dummy_rails/app/workers/exclude_random_raise_worker.rb +11 -0
  32. data/dummy_rails/app/workers/hard_worker.rb +15 -0
  33. data/dummy_rails/app/workers/lazy_worker.rb +10 -0
  34. data/dummy_rails/app/workers/random_raise_worker.rb +12 -0
  35. data/dummy_rails/app/workers/taco_worker.rb +12 -0
  36. data/dummy_rails/app/workers/tostada_worker.rb +11 -0
  37. data/dummy_rails/bin/rspec +5 -0
  38. data/dummy_rails/config.ru +5 -0
  39. data/dummy_rails/config/application.rb +20 -0
  40. data/dummy_rails/config/boot.rb +5 -0
  41. data/dummy_rails/config/environment.rb +5 -0
  42. data/dummy_rails/config/environments/development.rb +52 -0
  43. data/dummy_rails/config/environments/production.rb +88 -0
  44. data/dummy_rails/config/environments/test.rb +40 -0
  45. data/dummy_rails/config/initializers/assets.rb +14 -0
  46. data/dummy_rails/config/initializers/cookies_serializer.rb +5 -0
  47. data/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/dummy_rails/config/initializers/sidekiq-web_custom.rb +3 -0
  49. data/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
  50. data/dummy_rails/config/locales/en.yml +33 -0
  51. data/dummy_rails/config/puma.rb +37 -0
  52. data/dummy_rails/config/routes.rb +5 -0
  53. data/dummy_rails/config/secrets.yml +5 -0
  54. data/dummy_rails/config/spring.rb +5 -0
  55. data/dummy_rails/config/storage.yml +34 -0
  56. data/dummy_rails/package.json +5 -0
  57. data/dummy_rails/spec/spec_helper.rb +50 -0
  58. data/lib/load_random_workers.rb +25 -0
  59. data/lib/sidekiq/views/actions/queues/delete.erb +12 -0
  60. data/lib/sidekiq/views/actions/queues/drain_queue.erb +4 -0
  61. data/lib/sidekiq/views/actions/queues/pause.erb +13 -0
  62. data/lib/sidekiq/views/actions/retries/delete.erb +5 -0
  63. data/lib/sidekiq/views/actions/retries/execute.erb +7 -0
  64. data/lib/sidekiq/views/actions/scheduled/delete.erb +5 -0
  65. data/lib/sidekiq/views/actions/scheduled/execute.erb +7 -0
  66. data/lib/sidekiq/views/queues.erb +64 -0
  67. data/lib/sidekiq/views/retries.erb +123 -0
  68. data/lib/sidekiq/views/scheduled.erb +97 -0
  69. data/lib/sidekiq/web_custom.rb +95 -0
  70. data/lib/sidekiq/web_custom/configuration.rb +112 -0
  71. data/lib/sidekiq/web_custom/job.rb +11 -0
  72. data/lib/sidekiq/web_custom/processor.rb +82 -0
  73. data/lib/sidekiq/web_custom/queue.rb +12 -0
  74. data/lib/sidekiq/web_custom/timeout.rb +64 -0
  75. data/lib/sidekiq/web_custom/version.rb +14 -0
  76. data/lib/sidekiq/web_custom/web_action.rb +38 -0
  77. data/lib/sidekiq/web_custom/web_app.rb +46 -0
  78. data/sidekiq-web_custom.gemspec +37 -0
  79. metadata +151 -0
@@ -0,0 +1,40 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+
18
+ # Show full error reports and disable caching.
19
+ config.consider_all_requests_local = true
20
+ config.action_controller.perform_caching = false
21
+
22
+ # Raise exceptions instead of rendering exception templates.
23
+ config.action_dispatch.show_exceptions = false
24
+
25
+ # Disable request forgery protection in test environment.
26
+ config.action_controller.allow_forgery_protection = false
27
+
28
+ config.action_mailer.perform_caching = false
29
+
30
+ # Tell Action Mailer not to deliver emails to the real world.
31
+ # The :test delivery method accumulates sent emails in the
32
+ # ActionMailer::Base.deliveries array.
33
+ config.action_mailer.delivery_method = :test
34
+
35
+ # Print deprecation notices to the stderr.
36
+ config.active_support.deprecation = :stderr
37
+
38
+ # Raises error for missing translations
39
+ # config.action_view.raise_on_missing_translations = true
40
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+ # Add Yarn node_modules folder to the asset load path.
9
+ Rails.application.config.assets.paths << Rails.root.join('node_modules')
10
+
11
+ # Precompile additional assets.
12
+ # application.js, application.css, and all non-JS/CSS in the app/assets
13
+ # folder are already added.
14
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,3 @@
1
+ # require 'sidekiq/web_custom'
2
+
3
+ Sidekiq::WebCustom.configure
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at http://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,37 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ threads threads_count, threads_count
9
+
10
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11
+ #
12
+ port ENV.fetch("PORT") { 3000 }
13
+
14
+ # Specifies the `environment` that Puma will run in.
15
+ #
16
+ environment ENV.fetch("RAILS_ENV") { "development" }
17
+
18
+ # Specifies the `pidfile` that Puma will use.
19
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
20
+
21
+ # Specifies the number of `workers` to boot in clustered mode.
22
+ # Workers are forked webserver processes. If using threads and workers together
23
+ # the concurrency of the application would be max `threads` * `workers`.
24
+ # Workers do not work on JRuby or Windows (both of which do not support
25
+ # processes).
26
+ #
27
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
28
+
29
+ # Use the `preload_app!` method when specifying a `workers` number.
30
+ # This directive tells Puma to first boot the application and load code
31
+ # before forking the application. This takes advantage of Copy On Write
32
+ # process behavior so workers use less memory.
33
+ #
34
+ # preload_app!
35
+
36
+ # Allow puma to be restarted by `rails restart` command.
37
+ plugin :tmp_restart
@@ -0,0 +1,5 @@
1
+ require 'sidekiq/web_custom'
2
+
3
+ Rails.application.routes.draw do
4
+ mount Sidekiq::Web => '/'
5
+ end
@@ -0,0 +1,5 @@
1
+ development:
2
+ secret_key_base: this-is-not-a-secure-secret
3
+
4
+ test:
5
+ secret_key_base: this-is-a-better-secret1
@@ -0,0 +1,5 @@
1
+ %w[
2
+ .rbenv-vars
3
+ tmp/restart.txt
4
+ tmp/caching-dev.txt
5
+ ].each { |path| Spring.watch(path) }
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket
23
+
24
+ # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "dummy_rails",
3
+ "private": true,
4
+ "dependencies": {}
5
+ }
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'ice_age/freeze' # freeze ENV
5
+ require 'null_logger'
6
+ require 'pry'
7
+ require 'simplecov'
8
+
9
+
10
+ SimpleCov.start unless SimpleCov.running
11
+
12
+ RSpec.configure do |config|
13
+ # Enable flags like --only-failures and --next-failure
14
+ config.example_status_persistence_file_path = ".rspec_status"
15
+
16
+ # Disable RSpec exposing methods globally on `Module` and `main`
17
+ config.disable_monkey_patching!
18
+
19
+ config.expect_with :rspec do |c|
20
+ c.syntax = :expect
21
+ end
22
+
23
+ # allow 'fit' examples
24
+ config.filter_run_when_matching :focus
25
+
26
+ config.around(:each) do |example|
27
+ # only let Timecop operate in blocks
28
+ Timecop.safe_mode = true
29
+
30
+ # Freeze time by default
31
+ Timecop.freeze do
32
+ example.run
33
+ end
34
+ end
35
+
36
+ # remove stdout logging when running tests
37
+ Sidekiq.logger = NullLogger.new
38
+
39
+ # Run specs in random order to surface order dependencies. If you find an
40
+ # order dependency and want to debug it, you can fix the order by providing
41
+ # the seed, which is printed after each run.
42
+ # --seed 1234
43
+ config.order = :random
44
+
45
+ # Seed global randomization in this process using the `--seed` CLI option.
46
+ # Setting this allows you to use `--seed` to deterministically reproduce
47
+ # test failures related to randomization by passing the same `--seed` value
48
+ # as the one that triggered the failure.
49
+ Kernel.srand config.seed
50
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'byebug'
4
+
5
+ worker_files = Dir[Rails.root.join('app','workers','**','*_worker.rb').to_s]
6
+ require_workers = worker_files.map { |path| File.basename(path, '.rb') }
7
+ require_workers.each do |worker|
8
+ require worker
9
+ end
10
+
11
+ workers = ObjectSpace.each_object(Class).select do |klass|
12
+ klass.included_modules.include?(Sidekiq::Worker)
13
+ end
14
+
15
+
16
+ while true
17
+ workers.each do |worker|
18
+ sleep(0.5)
19
+ puts worker.perform_async
20
+ sleep(0.5)
21
+ puts worker.perform_at((rand*10).hours.from_now)
22
+ end
23
+ end
24
+
25
+ Dir.glob["#{APP_PATH}/app/workers/**/*_worker.rb"]
@@ -0,0 +1,12 @@
1
+ <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>" method="post" style="display: inline">
2
+ <%= csrf_tag %>
3
+ <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
4
+
5
+ <% if Sidekiq.pro? %>
6
+ <% if queue.paused? %>
7
+ <input class="btn btn-danger btn-xs" type="submit" name="unpause" value="<%= t('Unpause') %>" />
8
+ <% else %>
9
+ <input class="btn btn-danger btn-xs" type="submit" name="pause" value="<%= t('Pause') %>" />
10
+ <% end %>
11
+ <% end %>
12
+ </form>
@@ -0,0 +1,4 @@
1
+ <form onclick="_sidekiq_web_block_screen('Draining queue. Please Wait...')" action="<%=root_path %>queues/drain/<%= CGI.escape(queue.name) %>" method="post" style="display: inline">
2
+ <%= csrf_tag %>
3
+ <input class="btn btn-warn btn-xs" type="submit" name="drain_queue" value="Drain <%= Sidekiq::WebCustom.config.drain_rate %>" />
4
+ </form>
@@ -0,0 +1,13 @@
1
+ <% if Sidekiq.pro? %>
2
+ <% if queue.paused? %>
3
+ <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>/unpause" method="post" style="display: inline">
4
+ <%= csrf_tag %>
5
+ <input class="btn btn-success btn-xs" type="submit" name="unpause" value="<%= t('Unpause') %>" style="background-image: none" />
6
+ </form>
7
+ <% else %>
8
+ <form action="<%=root_path %>queues/<%= CGI.escape(queue.name) %>/pause" method="post" style="display: inline">
9
+ <%= csrf_tag %>
10
+ <input class="btn btn-warning btn-xs" type="submit" name="pause" value="<%= t('Pause') %>" style="background-image: none" />
11
+ </form>
12
+ <% end %>
13
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <form onclick="_sidekiq_web_block_screen('Deleting Job. Please Wait...')" action="<%=root_path %>job/delete" method="post" style="display: inline">
2
+ <%= csrf_tag %>
3
+ <input type="hidden" id="individual_job" name="entry.score" value='<%= job_params(entry.item, entry.score) %>' >
4
+ <input class="btn btn-danger btn-xs" type="submit" name='delete_job' value='Delete Job' />
5
+ </form>
@@ -0,0 +1,7 @@
1
+ <form onclick="_sidekiq_web_block_screen('Executing Job. Please Wait...')" action="<%=root_path %>job/execute" method="post" style="display: inline">
2
+ <%= csrf_tag %>
3
+ <input type="hidden" id="execute_job" name="entry.score" value='<%= job_params(entry.item, entry.score) %>' >
4
+ <input type="hidden" id="execute_job_type" name="entry.type" value='<%= request.url.split('/')[-1] %>' >
5
+ <input class="btn btn-warn btn-xs" type="submit" name='execute_job' value='Execute Job' />
6
+ </form>
7
+
@@ -0,0 +1,5 @@
1
+ <form onclick="_sidekiq_web_block_screen('Deleting Job. Please Wait...')" action="<%=root_path %>job/delete" method="post" style="display: inline">
2
+ <%= csrf_tag %>
3
+ <input type="hidden" id="individual_job" name="entry.score" value='<%= job_params(entry.item, entry.score) %>' >
4
+ <input class="btn btn-danger btn-xs" type="submit" name='delete_job' value='Delete Job' />
5
+ </form>
@@ -0,0 +1,7 @@
1
+ <form onclick="_sidekiq_web_block_screen('Executing Job. Please Wait...')" action="<%=root_path %>job/execute" method="post" style="display: inline">
2
+ <%= csrf_tag %>
3
+ <input type="hidden" id="execute_job" name="entry.score" value='<%= job_params(entry.item, entry.score) %>' >
4
+ <input type="hidden" id="execute_job_type" name="entry.type" value='<%= request.url.split('/')[-1] %>' >
5
+ <input class="btn btn-warn btn-xs" type="submit" name='execute_job' value='Execute Job' />
6
+ </form>
7
+
@@ -0,0 +1,64 @@
1
+ <h3><%= t('Queues') %></h3>
2
+
3
+ <div class="table_container">
4
+ <table class="queues table table-hover table-bordered table-striped">
5
+ <thead>
6
+ <th><%= t('Queue') %></th>
7
+ <th><%= t('Size') %></th>
8
+ <th><%= t('Latency') %></th>
9
+ <th><%= t('Actions') %></th>
10
+ </thead>
11
+ <% @queues.each do |queue| %>
12
+ <tr>
13
+ <td>
14
+ <a href="<%= root_path %>queues/<%= CGI.escape(queue.name) %>"><%= h queue.name %></a>
15
+ <% if queue.paused? %>
16
+ <span class="label label-danger"><%= t('Paused') %></span>
17
+ <% end %>
18
+ </td>
19
+ <td><%= number_with_delimiter(queue.size) %> </td>
20
+ <td><% queue_latency = queue.latency %><%= number_with_delimiter(queue_latency.round(2)) %><%= (queue_latency < 60) ? '' : " (#{relative_time(Time.at(Time.now.to_f - queue_latency))})" %> </td>
21
+
22
+ <td class="delete-confirm">
23
+ __sidekiq_web_custom_replacement__
24
+ </td>
25
+ </tr>
26
+ <% end %>
27
+ </table>
28
+ </div>
29
+
30
+ <div id="_sidekiq_web_block_screen_div_" style='display: none'>
31
+ <div id="_sidekiq_web_block_screen_text_"></div>
32
+ </div>
33
+
34
+ <script type="text/javascript">
35
+ function _sidekiq_web_block_screen(text) {
36
+ document.getElementById('_sidekiq_web_block_screen_text_').innerHTML = text
37
+ document.getElementById('_sidekiq_web_block_screen_div_').style.display = "block";
38
+ }
39
+ </script>
40
+
41
+ <style>
42
+ #_sidekiq_web_block_screen_div_ {
43
+ position: fixed;
44
+ display: none;
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ right: 0;
50
+ bottom: 0;
51
+ background-color: rgba(0,0,0,0.8);
52
+ z-index: 2;
53
+ }
54
+
55
+ #_sidekiq_web_block_screen_text_{
56
+ position: absolute;
57
+ top: 50%;
58
+ left: 50%;
59
+ font-size: 50px;
60
+ color: white;
61
+ transform: translate(-50%,-50%);
62
+ -ms-transform: translate(-50%,-50%);
63
+ }
64
+ </style>
@@ -0,0 +1,123 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3><%= t('Retries') %></h3>
4
+ </div>
5
+ <% if @retries.size > 0 && @total_size > @count %>
6
+ <div class="col-sm-4">
7
+ <%= erb :_paging, locals: { url: "#{root_path}retries" } %>
8
+ </div>
9
+ <% end %>
10
+ <%= filtering('retries') %>
11
+ </header>
12
+
13
+ <% if @retries.size > 0 %>
14
+ <form action="<%= root_path %>retries" method="post">
15
+ <%= csrf_tag %>
16
+ <div class="table_container">
17
+ <table class="table table-striped table-bordered">
18
+ <thead>
19
+ <tr>
20
+ <th class="table-checkbox checkbox-column">
21
+ <label>
22
+ <input type="checkbox" class="check_all" />
23
+ </label>
24
+ </th>
25
+ <th><%= t('NextRetry') %></th>
26
+ <th><%= t('RetryCount') %></th>
27
+ <th><%= t('Queue') %></th>
28
+ <th><%= t('Job') %></th>
29
+ <th><%= t('Arguments') %></th>
30
+ <th><%= t('Error') %></th>
31
+ <th> Actions </th>
32
+ </tr>
33
+ </thead>
34
+ <% @retries.each do |entry| %>
35
+ <tr>
36
+ <td class="table-checkbox">
37
+ <label>
38
+ <input type='checkbox' name='key[]' value='<%= job_params(entry.item, entry.score) %>' />
39
+ </label>
40
+ </td>
41
+ <td>
42
+ <a href="<%= root_path %>retries/<%= job_params(entry.item, entry.score) %>"><%= relative_time(entry.at) %></a>
43
+ </td>
44
+ <td><%= entry['retry_count'] %></td>
45
+ <td>
46
+ <a href="<%= root_path %>queues/<%= entry.queue %>"><%= entry.queue %></a>
47
+ </td>
48
+ <td>
49
+ <%= entry.display_class %>
50
+ <%= display_tags(entry, "retries") %>
51
+ </td>
52
+ <td>
53
+ <div class="args"><%= display_args(entry.display_args) %></div>
54
+ </td>
55
+ <td>
56
+ <div><%= h truncate("#{entry['error_class']}: #{entry['error_message']}", 200) %></div>
57
+ </td>
58
+ <td>
59
+ __sidekiq_web_custom_replacement__
60
+ </td>
61
+ </tr>
62
+ <% end %>
63
+ </table>
64
+ </div>
65
+ <input class="btn btn-primary btn-xs pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>" />
66
+ <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>" />
67
+ <input class="btn btn-danger btn-xs pull-left flip" type="submit" name="kill" value="<%= t('Kill') %>" />
68
+ </form>
69
+
70
+ <% unfiltered? do %>
71
+ <form action="<%= root_path %>retries/all/delete" method="post">
72
+ <%= csrf_tag %>
73
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="delete" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
74
+ </form>
75
+ <form action="<%= root_path %>retries/all/retry" method="post">
76
+ <%= csrf_tag %>
77
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="retry" value="<%= t('RetryAll') %>" data-confirm="<%= t('AreYouSure') %>" />
78
+ </form>
79
+ <form action="<%= root_path %>retries/all/kill" method="post">
80
+ <%= csrf_tag %>
81
+ <input class="btn btn-danger btn-xs pull-right flip" type="submit" name="kill" value="<%= t('KillAll') %>" data-confirm="<%= t('AreYouSure') %>" />
82
+ </form>
83
+ <% end %>
84
+
85
+ <% else %>
86
+ <div class="alert alert-success"><%= t('NoRetriesFound') %></div>
87
+ <% end %>
88
+
89
+ <div id="_sidekiq_web_block_screen_div_" style='display: none'>
90
+ <div id="_sidekiq_web_block_screen_text_"></div>
91
+ </div>
92
+
93
+ <script type="text/javascript">
94
+ function _sidekiq_web_block_screen(text) {
95
+ document.getElementById('_sidekiq_web_block_screen_text_').innerHTML = text
96
+ document.getElementById('_sidekiq_web_block_screen_div_').style.display = "block";
97
+ }
98
+ </script>
99
+
100
+ <style>
101
+ #_sidekiq_web_block_screen_div_ {
102
+ position: fixed;
103
+ display: none;
104
+ width: 100%;
105
+ height: 100%;
106
+ top: 0;
107
+ left: 0;
108
+ right: 0;
109
+ bottom: 0;
110
+ background-color: rgba(0,0,0,0.8);
111
+ z-index: 2;
112
+ }
113
+
114
+ #_sidekiq_web_block_screen_text_{
115
+ position: absolute;
116
+ top: 50%;
117
+ left: 50%;
118
+ font-size: 50px;
119
+ color: white;
120
+ transform: translate(-50%,-50%);
121
+ -ms-transform: translate(-50%,-50%);
122
+ }
123
+ </style>