Module: ForemanMonitoring::HostsHelperExt

Extended by:
ActiveSupport::Concern
Defined in:
app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb

Instance Method Summary collapse

Instance Method Details

#host_monitoring_result_class(result) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb', line 33

def host_monitoring_result_class(result)
  case result
  when :ok
    'status-ok'
  when :warning
    'status-warn'
  when :critical
    'status-error'
  else
    'status-question'
  end
end

#host_monitoring_result_icon_class(result) ⇒ Object

def host_title_actions_with_monitoring(host)

title_actions(
  button_group(
    link_to(_('Monitoring'), monitoring_show_host_path(host), :target => '_blank', :class => 'btn btn-default')
  )
)
host_title_actions_without_monitoring(host)

end



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb', line 18

def host_monitoring_result_icon_class(result)
  icon_class = case result
               when :ok
                 'pficon-ok'
               when :warning
                 'pficon-info'
               when :critical
                 'pficon-error-circle-o'
               else
                 'pficon-help'
               end

  "host-status #{icon_class} #{host_monitoring_result_class(result)}"
end