lib/sidetiq/web.rb in sidetiq-0.3.6 vs lib/sidetiq/web.rb in sidetiq-0.3.7
- old
+ new
@@ -16,30 +16,30 @@
end
app.get "/sidetiq" do
@schedules = sidetiq_schedules
@time = sidetiq_clock.gettime
- slim File.read(File.join(VIEWS, 'sidetiq.slim'))
+ erb File.read(File.join(VIEWS, 'sidetiq.erb'))
end
app.get "/sidetiq/:name" do
halt 404 unless (name = params[:name])
@time = sidetiq_clock.gettime
- @worker, @schedule = sidetiq_schedules.select do |worker, schedule|
+ @worker, @schedule = sidetiq_schedules.select do |worker, _|
worker.name == name
end.flatten
- slim File.read(File.join(VIEWS, 'sidetiq_details.slim'))
+ erb File.read(File.join(VIEWS, 'sidetiq_details.erb'))
end
app.post "/sidetiq/:name/trigger" do
halt 404 unless (name = params[:name])
- worker, _ = sidetiq_schedules.select do |worker, schedule|
- worker.name == name
+ worker, _ = sidetiq_schedules.select do |w, _|
+ w.name == name
end.flatten
worker.perform_async
redirect "#{root_path}sidetiq"
@@ -47,12 +47,7 @@
end
end
end
Sidekiq::Web.register(Sidetiq::Web)
-
-if Sidekiq::Web.tabs.is_a?(Array)
- Sidekiq::Web.tabs << "sidetiq"
-else
- Sidekiq::Web.tabs["Sidetiq"] = "sidetiq"
-end
+Sidekiq::Web.tabs["Sidetiq"] = "sidetiq"