Module: ForemanPuppet::HostsHelper

Defined in:
app/helpers/foreman_puppet/hosts_helper.rb

Instance Method Summary collapse

Instance Method Details

#puppet_host_multiple_actionsObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/foreman_puppet/hosts_helper.rb', line 9

def puppet_host_multiple_actions
  if ForemanPuppet.extracted_from_core?
    actions = [{ action: [_('Change Environment'), foreman_puppet.select_multiple_environment_hosts_path], priority: 200 }]
    if authorized_for(controller: :hosts, action: :edit) && SmartProxy.unscoped.authorized.with_features('Puppet').exists?
      actions << { action: [_('Change Puppet Master'), foreman_puppet.select_multiple_puppet_proxy_hosts_path], priority: 1050 }
    end
    actions
  else
    []
  end
end

#puppet_host_overview_buttons(host) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'app/helpers/foreman_puppet/hosts_helper.rb', line 21

def puppet_host_overview_buttons(host)
  buttons = []
  if SmartProxy.with_features('Puppet').any?
    buttons << {
      button: link_to(_('Puppet YAML'), foreman_puppet.externalNodes_host_path(name: host), title: _('Puppet external nodes YAML dump'),
                                                                                            class: 'btn btn-default'), priority: 400
    }
  end
  buttons
end