Class: Kuiq::UI

Inherits:
Object
  • Object
show all
Includes:
Glimmer
Defined in:
lib/kuiq.rb

Instance Method Summary collapse

Constructor Details

#initializeUI

Returns a new instance of UI.



13
14
15
# File 'lib/kuiq.rb', line 13

def initialize
  @info = Sidekiq.default_configuration.redis_info
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/kuiq.rb', line 17

def run
  window {
    margined true
    title "Sidekiq"

    vertical_box {
      @navbar = horizontal_box {
        label "Sidekiq"
        label "Dashboard"
        label "Busy"
        label "Queues"
        label "Retries"
        label "Scheduled"
        label "Dead"
      }

      @dashboard = horizontal_box {
        vertical_box {
          label "Redis Version"
          label @info["redis_version"]
        }
        vertical_box {
          label "Uptime"
          label @info["uptime_in_days"]
        }
        vertical_box {
          label "Connections"
          label @info["connected_clients"]
        }
        vertical_box {
          label "Used Memory"
          label @info["used_memory_human"]
        }
        vertical_box {
          label "Peak Used Memory"
          label @info["used_memory_peak_human"]
        }
      }

      @footer = horizontal_box {
        label("#{Sidekiq::NAME} v#{Sidekiq::VERSION}")
        label(Sidekiq.redis { |c| c.config.server_url })
        label(Time.now.utc.strftime("%H:%M:%S UTC"))
        label "docs"
        label "en"
      }
    }
  }.show
end