class ActiveAdminSidekiqStats::Panel
Public Class Methods
inject()
click to toggle source
# File lib/activeadmin_sidekiq_stats/panel.rb, line 5 def self.inject klass = new klass.inject! end
Public Instance Methods
inject!()
click to toggle source
# File lib/activeadmin_sidekiq_stats/panel.rb, line 10 def inject! html = Arbre::Context.new do panel "Sidekiq Stats" do begin sidekiq = JSON.parse(::Sidekiq::Stats.new.to_json) stats = sidekiq.fetch("stats", Hash.new) div style: "display: flex; justify-content: center; align-items: center" do stats.each do |process_name, process_value| div style: "display: flex; flex:1; justify-content: center; align-items: center; flex-direction: column" do h1 process_value span process_name.titleize end end end rescue Redis::CannotConnectError h1 "Redis Connection Failed" end end end html.to_s end
Private Instance Methods
container_style()
click to toggle source
# File lib/activeadmin_sidekiq_stats/panel.rb, line 34 def container_style "display: flex; justify-content: center; align-items: center" end
item_style()
click to toggle source
# File lib/activeadmin_sidekiq_stats/panel.rb, line 38 def item_style "flex:1; justify-content: center;" end