Sha256: 7877488fa9301ed927af6f85006fb51dbd87794413a925e2c3b971bdade4654f
Contents?: true
Size: 1.31 KB
Versions: 1
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true require "sidekiq/web/helpers" module Sidekiq module Belt module Pro module FailedBatchRemove module SidekiqFailedBatchRemove REMOVE_BUTTON = <<~ERB <form action="<%= root_path %>batches/<%= bid %>/remove" method="post"> <%= csrf_tag %> <input class="btn btn-danger" type="submit" name="remove" value="<%= t('Remove') %>" data-confirm="Do you want to remove batch <%= bid %>? <%= t('AreYouSure') %>" /> </form> ERB def self.registered(app) app.replace_content("/batches") do |content| content.gsub!("</th>\n <%", "</th><th><%= t('Delete') %></th>\n <%") content.gsub!( "</td>\n </tr>\n <% end %>", "</td>\n<td>#{REMOVE_BUTTON}</td>\n </tr>\n <% end %>" ) end app.post("/batches/:bid/remove") do Sidekiq::Batch::Status.new(params[:bid]).delete return redirect "#{root_path}batches" end end end def self.use! require("sidekiq/web") Sidekiq::Web.register(Sidekiq::Belt::Pro::FailedBatchRemove::SidekiqFailedBatchRemove) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sidekiq-belt-1.0.0 | lib/sidekiq/belt/pro/failed_batch_remove.rb |