Sha256: d34605c9e51937cbd5b393ad1b6b3c800a86649b6890bd0387ca30ee99b81034

Contents?: true

Size: 785 Bytes

Versions: 9

Compression:

Stored size: 785 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
    
    def rocket_job_mission_control
      @@rocket_job_mission_control_engine_url_helpers ||= RocketJobMissionControl::Engine.routes.url_helpers
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rocketjob_mission_control-6.1.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.7 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.6 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.5 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.4 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.3 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.2 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.1 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-6.0.0 app/helpers/rocket_job_mission_control/servers_helper.rb