Sha256: 9051c69017fd213dc0582d425a936409199cc8cbbaf474a6ce1f9d86c8d22339

Contents?: true

Size: 629 Bytes

Versions: 11

Compression:

Stored size: 629 Bytes

Contents

module RocketJobMissionControl
  module ServersHelper
    def server_counts_by_state(state)
      @server_counts.fetch(state.downcase.to_sym, 0)
    end

    def server_icon(server)
      state =
        if server.zombie?
          'zombie'
        else
          server.state
        end
      state_icon(state)
    end

    def server_card_class(server)
      if server.zombie?
        'callout-zombie'
      else
        map = {
          running:  'callout-success',
          paused:   'callout-warning',
          stopping: 'callout-alert',
        }
        map[server.state] || 'callout-info'
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rocketjob_mission_control-4.3.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-4.2.1 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-4.2.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-4.1.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-4.0.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-3.2.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-3.1.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-3.0.3 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-3.0.2 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-3.0.1 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-3.0.0 app/helpers/rocket_job_mission_control/servers_helper.rb