Module: ForemanMonitoring::HostsHelperExt
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb
Instance Method Summary collapse
- #datetime_f(f, attr, options = {}) ⇒ Object
- #host_monitoring_result_class(result) ⇒ Object
- #host_monitoring_result_icon_class(result) ⇒ Object
- #host_title_actions_with_monitoring(host) ⇒ Object
- #multiple_actions_with_monitoring ⇒ Object
Instance Method Details
#datetime_f(f, attr, options = {}) ⇒ Object
61 62 63 64 65 66 |
# File 'app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb', line 61 def datetime_f(f, attr, = {}) field(f, attr, ) do addClass , 'form-control' f.datetime_local_field attr, end end |
#host_monitoring_result_class(result) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb', line 48 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
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb', line 33 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 |
#host_title_actions_with_monitoring(host) ⇒ Object
15 16 17 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 15 def host_title_actions_with_monitoring(host) title_actions( ( (_('Downtime'), hash_for_host_path(:id => host).merge(:auth_object => host, :permission => :manage_host_downtimes, :anchor => 'set_host_downtime'), :class => 'btn btn-default', :disabled => !host.monitored?, :title => _('Set a downtime for this host'), :id => 'host-downtime', :data => { :toggle => 'modal', :target => '#set_host_downtime' }) ) ) host_title_actions_without_monitoring(host) end |
#multiple_actions_with_monitoring ⇒ Object
10 11 12 13 |
# File 'app/helpers/concerns/foreman_monitoring/hosts_helper_ext.rb', line 10 def multiple_actions_with_monitoring return multiple_actions_without_monitoring unless (:controller => :hosts, :action => :select_multiple_downtime) multiple_actions_without_monitoring + [[_('Set downtime'), select_multiple_downtime_hosts_path], [_('Change Monitoring Proxy'), select_multiple_monitoring_proxy_hosts_path]] end |