Module: Sidekiq::Belt::Ent::PeriodicPause::SidekiqLoopsPeriodicPause

Defined in:
lib/sidekiq/belt/ent/periodic_pause.rb

Constant Summary collapse

PAUSE_BUTTON =
<<~ERB
  name="pause" data-confirm="Pause the job <%= loup.klass %>? <%= t('AreYouSure') %>"
ERB
UNPAUSE_BUTTON =
<<~ERB
  name="unpause" data-confirm="Unpause the job <%= loup.klass %>? <%= t('AreYouSure') %>"
ERB

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/sidekiq/belt/ent/periodic_pause.rb', line 18

def self.registered(app)
  app.replace_content("/loops") do |content|
    content.gsub!("</header>", "</header>
      <style>
        .btn-unpause {
          color: #000;
          background-image: none;
          background-color: #ddd;
        }
        .btn-unpause:hover {
          border: 1px solid;
        }
      </style>")

    content.gsub!("name=\"pause\"", PAUSE_BUTTON)
    content.gsub!("name=\"unpause\"", UNPAUSE_BUTTON)
  end
end