Sha256: 83c0fc0456436c7ffc615730d4852899bdeabc0ba92953d001cd4943db08378e

Contents?: true

Size: 628 Bytes

Versions: 4

Compression:

Stored size: 628 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

4 entries across 4 versions & 1 rubygems

Version Path
rocketjob_mission_control-6.0.0.beta app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-5.0.1 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-5.0.0 app/helpers/rocket_job_mission_control/servers_helper.rb
rocketjob_mission_control-5.0.0.beta1 app/helpers/rocket_job_mission_control/servers_helper.rb