Module: ForemanRemoteExecution::HostsHelperExtensions
- Defined in:
- app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb
Instance Method Summary collapse
- #host_title_actions(*args) ⇒ Object
- #multiple_actions ⇒ Object
- #schedule_job_button(*args) ⇒ Object
- #schedule_job_multi_button(*args) ⇒ Object
- #web_console_button(host, *args) ⇒ Object
Instance Method Details
#host_title_actions(*args) ⇒ Object
29 30 31 32 33 |
# File 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb', line 29 def host_title_actions(*args) title_actions(((*args)), ((*args))) super(*args) end |
#multiple_actions ⇒ Object
3 4 5 |
# File 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb', line 3 def multiple_actions super + [ [_('Schedule Remote Job'), new_job_invocation_path, false] ] end |
#schedule_job_button(*args) ⇒ Object
19 20 21 |
# File 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb', line 19 def (*args) link_to(_('Schedule Remote Job'), new_job_invocation_path(:host_ids => [args.first.id]), :id => :run_button, :class => 'btn btn-default') end |
#schedule_job_multi_button(*args) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb', line 7 def (*args) host_features = RemoteExecutionFeature..order(:label).map do |feature| link_to(_('%s') % feature.name, job_invocations_path(:host_ids => [args.first.id], :feature => feature.label), :method => :post) end if host_features.present? ((*args), *host_features) else (*args) end end |
#web_console_button(host, *args) ⇒ Object
23 24 25 26 27 |
# File 'app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb', line 23 def (host, *args) return unless (permission: 'cockpit_hosts', auth_object: host) url = SSHExecutionProvider.cockpit_url_for_host(host.name) url ? link_to(_('Web Console'), url, :class => 'btn btn-default', :id => :'web-console-button') : nil end |