Sha256: 0b8e2edb583a9c62315c40665165ff9ad1c6f915cbf4d1a074268be045f29218

Contents?: true

Size: 1.21 KB

Versions: 57

Compression:

Stored size: 1.21 KB

Contents

module Opsicle
  module Monitor
    module Panels
      class Instances < Monitor::Panel

        def initialize(height, width, top, left)
          super(height, width, top, left, structure(height), :divider_r => " ")

          @spies[:instances] = Monitor::Spy::Instances.new
        end

        def structure(height)
          # [
          #   [relative_column_width, data_left, data_right]
          # ]
          s = [
            [ # table header slots
              [1, translate[:heading][:ec2_instance_id], nil],
              [1, translate[:heading][:hostname], nil],
              [1, translate[:heading][:status], nil],
              [1, translate[:heading][:zone], nil],
              [1, translate[:heading][:ip], nil]
            ],
          ]

          (0...(height - 1)).each do |i|
            s << [ # table row slots
              [1, -> { @spies[:instances][i][:ec2_instance_id] }, nil],
              [1, -> { @spies[:instances][i][:hostname] }, nil],
              [1, -> { @spies[:instances][i][:status] }, nil],
              [1, -> { @spies[:instances][i][:zone] }, nil],
              [1, -> { @spies[:instances][i][:ip] }, nil]
            ]
          end

          s
        end

      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
opsicle-2.15.0 lib/opsicle/monitor/panels/instances.rb
opsicle-2.14.2 lib/opsicle/monitor/panels/instances.rb
opsicle-2.14.1 lib/opsicle/monitor/panels/instances.rb
opsicle-2.14.0 lib/opsicle/monitor/panels/instances.rb
opsicle-2.13.1 lib/opsicle/monitor/panels/instances.rb
opsicle-2.13.0 lib/opsicle/monitor/panels/instances.rb
opsicle-2.12.5 lib/opsicle/monitor/panels/instances.rb
opsicle-2.12.3 lib/opsicle/monitor/panels/instances.rb
opsicle-2.12.2 lib/opsicle/monitor/panels/instances.rb
opsicle-2.12.1 lib/opsicle/monitor/panels/instances.rb
opsicle-2.12.0 lib/opsicle/monitor/panels/instances.rb
opsicle-2.11.3 lib/opsicle/monitor/panels/instances.rb
opsicle-2.11.1 lib/opsicle/monitor/panels/instances.rb
opsicle-2.11.0 lib/opsicle/monitor/panels/instances.rb
opsicle-2.10.1 lib/opsicle/monitor/panels/instances.rb
opsicle-2.10.0 lib/opsicle/monitor/panels/instances.rb
opsicle-2.9.6 lib/opsicle/monitor/panels/instances.rb
opsicle-2.9.4 lib/opsicle/monitor/panels/instances.rb
opsicle-2.9.3 lib/opsicle/monitor/panels/instances.rb
opsicle-2.9.2 lib/opsicle/monitor/panels/instances.rb