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-0.15.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.14.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.13.1 lib/opsicle/monitor/panels/instances.rb
opsicle-0.13.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.12.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.11.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.10.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.9.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.8.2 lib/opsicle/monitor/panels/instances.rb
opsicle-0.8.1 lib/opsicle/monitor/panels/instances.rb
opsicle-0.8.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.7.1 lib/opsicle/monitor/panels/instances.rb
opsicle-0.7.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.6.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.5.1 lib/opsicle/monitor/panels/instances.rb
opsicle-0.5.0 lib/opsicle/monitor/panels/instances.rb
opsicle-0.4.2 lib/opsicle/monitor/panels/instances.rb