Revision c8ce839a
Added by Ohad Levy over 12 years ago
- ID c8ce839aa6c3849d53adae0d4e8385c78cb0251b
app/helpers/hosts_helper.rb | ||
---|---|---|
['Change Group', select_multiple_hostgroup_hosts_path],
|
||
['Change Environment', select_multiple_environment_hosts_path],
|
||
['Edit Parameters', multiple_parameters_hosts_path],
|
||
['Destroy Hosts', multiple_destroy_hosts_path],
|
||
['Delete Hosts', multiple_destroy_hosts_path],
|
||
['Disable Notifications', multiple_disable_hosts_path],
|
||
['Enable Notifications', multiple_enable_hosts_path],
|
||
]
|
app/views/home/_settings.html.erb | ||
---|---|---|
<div id="settings_dropdown" class="dropdown_header" >
|
||
<a href="#">Settings ▼</a>
|
||
|
||
<% choices = []
|
||
choices += [['Architectures', :architectures]]
|
||
choices += [['Bookmarks', :bookmarks]]
|
||
choices += [['Domains', :domains]]
|
||
choices += [['Environments', :environments]]
|
||
choices += [['Foreman Settings', :settings]]
|
||
choices += [['Global Parameters', :common_parameters]]
|
||
choices += [['Hardware Models', :models]]
|
||
choices += [['Host Groups', :hostgroups]]
|
||
choices += [['Installation Media', :media]]
|
||
choices += [['LDAP Authentication', :auth_source_ldaps]]
|
||
choices += [['Operating Systems', :operatingsystems]]
|
||
choices += [['Partition Tables', :ptables]]
|
||
choices += [['Provisioning Templates', :config_templates]]
|
||
choices += [['Puppet Classes', :puppetclasses]]
|
||
choices += [['Smart Proxies', :smart_proxies]]
|
||
choices += [['Subnets', :subnets]]
|
||
<%
|
||
choices = [
|
||
['Bookmarks', :bookmarks],
|
||
['Environments', :environments],
|
||
['Foreman Settings', :settings],
|
||
['Global Parameters', :common_parameters],
|
||
['Host Groups', :hostgroups],
|
||
['LDAP Authentication', :auth_source_ldaps],
|
||
['Puppet Classes', :puppetclasses],
|
||
['Smart Proxies', :smart_proxies]
|
||
]
|
||
|
||
choices += [
|
||
['Architectures', :architectures],
|
||
['Domains', :domains],
|
||
['Hardware Models', :models],
|
||
['Installation Media', :media],
|
||
['Operating Systems', :operatingsystems],
|
||
['Partition Tables', :ptables],
|
||
['Provisioning Templates', :config_templates],
|
||
['Subnets', :subnets]
|
||
] if SETTINGS[:unattended]
|
||
|
||
choices += [
|
||
['Users', :users],
|
app/views/hosts/edit.html.erb | ||
---|---|---|
<span class="title_action">
|
||
<%= link_to "Show", @host %>
|
||
<%= link_to "View All", hosts_path %>
|
||
<%= display_link_if_authorized (@host.managed? ? "Unmanage host" : "Manage host"), hash_for_toggle_manage_host_path(:id => @host.name), {:method => :put} %>
|
||
<% if SETTINGS[:unattended] -%>
|
||
<%= display_link_if_authorized (@host.managed? ? "Unmanage host" : "Manage host"),
|
||
hash_for_toggle_manage_host_path(:id => @host.name), {:method => :put} %>
|
||
<% end -%>
|
||
</span>
|
||
|
||
<%= render :partial => 'form' %>
|
||
<%= render :partial => 'form' %>
|
config/initializers/foreman.rb | ||
---|---|---|
SETTINGS[:login] ||= SETTINGS[:ldap]
|
||
|
||
begin
|
||
require 'virt'
|
||
SETTINGS[:libvirt] = true
|
||
if SETTINGS[:unattended]
|
||
require 'virt'
|
||
SETTINGS[:libvirt] = true
|
||
else
|
||
SETTINGS[:libvirt] = false
|
||
end
|
||
rescue LoadError
|
||
RAILS_DEFAULT_LOGGER.debug "Libvirt binding are missing - hypervisor management is disabled"
|
||
SETTINGS[:libvirt] = false
|
config/routes.rb | ||
---|---|---|
map.statistics '/statistics', :controller => 'statistics'
|
||
map.resources :notices, :only => :destroy
|
||
map.resources :audits, :collection => {:auto_complete_search => :get}
|
||
map.resources :usergroups
|
||
map.resources :domains, :requirements => {:id => /[^\/]+/}, :collection => {:auto_complete_search => :get}
|
||
map.resources :operatingsystems, :member => {:bootfiles => :get}, :collection => {:auto_complete_search => :get}
|
||
map.resources :media, :collection => {:auto_complete_search => :get}
|
||
map.resources :models, :collection => {:auto_complete_search => :get}
|
||
map.resources :architectures, :collection => {:auto_complete_search => :get}
|
||
if SETTINGS[:login]
|
||
map.resources :usergroups
|
||
map.resources :users, :collection => {:login => [:get, :post], :logout => :get, :auth_source_selected => :get, :auto_complete_search => :get}
|
||
map.resources :roles, :collection => {:report => [:get, :post], :auto_complete_search => :get}
|
||
end
|
||
|
||
if SETTINGS[:unattended]
|
||
map.resources :domains, :requirements => {:id => /[^\/]+/}, :collection => {:auto_complete_search => :get}
|
||
map.resources :operatingsystems, :member => {:bootfiles => :get}, :collection => {:auto_complete_search => :get}
|
||
map.resources :media, :collection => {:auto_complete_search => :get}
|
||
map.resources :models, :collection => {:auto_complete_search => :get}
|
||
map.resources :architectures, :collection => {:auto_complete_search => :get}
|
||
map.resources :ptables, :collection => {:auto_complete_search => :get}
|
||
map.resources :config_templates, :except => [:show], :collection => { :auto_complete_search => :get }, :requirements => { :id => /[^\/]+/ }
|
||
map.resources :subnets, :except => [:show], :collection => {:auto_complete_search => :get}
|
||
map.connect 'unattended/template/:id/:hostgroup', :controller => "unattended", :action => "template"
|
||
end
|
||
|
||
map.resources :lookup_keys, :except => [:new, :create], :requirements => {:id => /[^\/]+/} do |keys|
|
||
keys.resources :lookup_values, :only => [:index, :create, :update, :destroy]
|
||
end
|
||
... | ... | |
map.resources :facts, :only => [:index, :show], :requirements => {:id => /[^\/]+/} do |facts|
|
||
facts.resources :values, :requirements => {:id => /[^\/]+/}, :only => :index, :controller => :fact_values
|
||
end
|
||
map.resources :ptables, :collection => {:auto_complete_search => :get}
|
||
map.resources :roles, :collection => {:report => [:get, :post], :auto_complete_search => :get}
|
||
map.resources :auth_source_ldaps
|
||
map.resources :users, :collection => {:login => [:get, :post], :logout => :get, :auth_source_selected => :get, :auto_complete_search => :get}
|
||
map.resources :config_templates, :except => [:show], :collection => { :auto_complete_search => :get }, :requirements => { :id => /[^\/]+/ }
|
||
map.resources :smart_proxies, :except => [:show] do |proxy|
|
||
proxy.resources :puppetca, :controller => "SmartProxies::Puppetca", :only => [:index, :update, :destroy], :requirements => { :id => /[^\.][\w\.-]+/ }
|
||
proxy.resources :autosign, :controller => "SmartProxies::Autosign", :only => [:index, :new, :create, :destroy], :requirements => { :id => /[^\.][\w\.-]+/ }
|
||
end
|
||
map.resources :subnets, :except => [:show], :collection => {:auto_complete_search => :get}
|
||
map.resources :hypervisors, :requirements => { :id => /[^\/]+/ } do |hypervisor|
|
||
hypervisor.resources :guests, :controller => "Hypervisors::Guests", :except => [:edit],
|
||
:member => {:power => :put}, :requirements => { :id => /[^\.][\w\.-]+/ }
|
||
end if SETTINGS[:libvirt]
|
||
map.resources :bookmarks, :except => [:show], :requirements => { :id => /[^\/]+/ }
|
||
map.resources :settings, :only => [:index, :update]
|
||
map.connect 'unattended/template/:id/:hostgroup', :controller => "unattended", :action => "template"
|
||
map.connect '/status', :controller => "home", :action => "status"
|
||
|
||
#default
|
Also available in: Unified diff
fixes #1187 remove unrequired menus when foreman is not used for provisioning
this includes URLS, setting menu items and buttons.