Skip to content

Commit

Permalink
Better pause button (#6)
Browse files Browse the repository at this point in the history
* Better pause button

* Changelog
  • Loading branch information
dannnylo authored Nov 1, 2023
1 parent 799108c commit c2328b8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
## [Unreleased]

## [0.3.0] - 2023-10-07
## [0.3.1] - 2023-11-01

- Added style to pause button

## [0.3.0] - 2023-10-28

- Feature to add button to remove failed batches

## [0.2.0] - 2023-10-07
## [0.2.0] - 2023-10-14

- Feature to Pause/Unpause Periodic Jobs

## [0.1.0] - 2023-10-07
## [0.1.0] - 2023-10-12

- Feature to run manualy Periodic Jobs
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
sidekiq-belt (0.3.0)
sidekiq-belt (0.3.1)
sidekiq (> 7.1.4)

GEM
Expand Down
16 changes: 14 additions & 2 deletions lib/sidekiq/belt/ent/periodic_pause.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,33 @@ module SidekiqLoopsPeriodicPause
PAUSE_BUTTON = <<~ERB
<form action="<%= root_path %>loops/<%= loup.lid %>/pause" method="post">
<%= csrf_tag %>
<input class="btn btn-danger" type="submit" name="pause" value="<%= t('Pause') %>"
<input class="btn btn-danger btn-pause" type="submit" name="pause" value="<%= t('Pause') %>"
data-confirm="Pause the job <%= loup.klass %>? <%= t('AreYouSure') %>" />
</form>
ERB

UNPAUSE_BUTTON = <<~ERB
<form action="<%= root_path %>loops/<%= loup.lid %>/unpause" method="post">
<%= csrf_tag %>
<input class="btn btn-danger" type="submit" name="pause" value="<%= t('Unpause') %>"
<input class="btn btn-danger btn-unpause" type="submit" name="pause" value="<%= t('Unpause') %>"
data-confirm="Unpause the job <%= loup.klass %>? <%= t('AreYouSure') %>" />
</form>
ERB

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>")

# Add the top of the table
content.gsub!("</th>\n </tr>", "</th><th><%= t('Pause/Unpause') %></th></th>\n </tr>")

Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/belt/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Sidekiq
module Belt
VERSION = "0.3.0"
VERSION = "0.3.1"
end
end

0 comments on commit c2328b8

Please sign in to comment.