foreman/app/views/hosts/_form.html.erb @ 611f5bff
334d0359 | Amos Benari | <%= javascript 'host_edit', 'compute_resource', 'lookup_keys'%>
|
|
30ae12bf | Ohad Levy | <%= render "conflicts" if @host.errors[:conflict].any? %>
|
|
dd42df0a | Ohad Levy | <%= render "progress" %>
|
|
<%= form_for @host, :html => {:'data-submit' => 'progress_bar'} do |f| %>
|
|||
05ab4c16 | Ohad Levy | <%= base_errors_for @host %>
|
|
b09b4515 | Ohad Levy | ||
82e47ae0 | Amos Benari | <ul class="nav nav-tabs" data-tabs="tabs">
|
|
6241f2ee | Sam Kottler | <li class="active"><a href="#primary" data-toggle="tab">Host</a></li>
|
|
82e47ae0 | Amos Benari | <li><a href="#puppet_klasses" data-toggle="tab">Puppet Classes</a></li>
|
|
05ab4c16 | Ohad Levy | <% if SETTINGS[:unattended] and @host.managed -%>
|
|
82e47ae0 | Amos Benari | <li><a href="#network" data-toggle="tab">Network</a></li>
|
|
<li><a href="#os" data-toggle="tab">Operating System</a></li>
|
|||
41327e0c | Greg Sutcliffe | <% if authorized_for("Compute::Resources::Vms", :create) -%>
|
|
82e47ae0 | Amos Benari | <li id="compute_resource_tab" <%= display? !(@host.compute_resource_id || params[:host] && params[:host][:compute_resource_id].present?)%>><a href="#compute_resource" data-toggle="tab">Virtual Machine</a></li>
|
|
05ab4c16 | Ohad Levy | <% end -%>
|
|
<% end -%>
|
|||
298756ca | Amos Benari | <li><a href="#params" id='params-tab' data-url='<%= current_parameters_hosts_path %>' data-url2='<%= puppetclass_parameters_hosts_path %>' data-toggle="tab">Parameters</a></li>
|
|
82e47ae0 | Amos Benari | <li><a href="#info" data-toggle="tab">Additional Information</a></li>
|
|
05ab4c16 | Ohad Levy | </ul>
|
|
<div class="tab-content">
|
|||
82e47ae0 | Amos Benari | <div class="tab-pane active" id="primary">
|
|
<%= text_f f, :name, :class => "input-xlarge", :value => name_field(@host) %>
|
|||
611f5bff | Amos Benari | ||
<% if show_organization_tab? %>
|
|||
<%= select_f f, :organization_id, Organization.my_organizations, :id, :to_label,
|
|||
{ :include_blank => true },
|
|||
{ :onchange => 'organization_changed(this);', :label => "Organization", :'data-host-id' => @host.id,
|
|||
:'data-url' => process_taxonomy_hosts_path, :selected => Organization.my_organizations,
|
|||
:help_inline => image_tag('spinner.gif', :id => 'organization_indicator', :class => 'hide').html_safe } %>
|
|||
<% end %>
|
|||
<% if show_location_tab? %>
|
|||
<%= select_f f, :location_id, Location.my_locations, :id, :to_label,
|
|||
{ :include_blank => true},
|
|||
{ :onchange => 'location_changed(this);', :label => "Location", :"data-host-id" => @host.id,
|
|||
:'data-url' => process_taxonomy_hosts_path, :selected => Location.my_locations,
|
|||
:help_inline => image_tag('spinner.gif', :id => 'location_indicator', :class => 'hide').html_safe } %>
|
|||
<% end %>
|
|||
3f482b82 | Ohad Levy | <%= select_f f, :compute_resource_id, ComputeResource.my_compute_resources, :id, :to_label,
|
|
334d0359 | Amos Benari | { :include_blank => 'Bare Metal' },
|
|
{:label => "Deploy on", :disabled => !@host.new_record?, :'data-url' => compute_resource_selected_hosts_path ,
|
|||
d4327e6e | Ohad Levy | :onchange => 'computeResourceSelected(this);'} if SETTINGS[:unattended] && @host.new_record? || @host.compute_resource_id %>
|
|
611f5bff | Amos Benari | ||
05ab4c16 | Ohad Levy | <%= select_f f, :hostgroup_id, accessible_hostgroups, :id, :to_label,
|
|
017e1049 | Ohad Levy | { :include_blank => true},
|
|
6c8f473c | Amos Benari | { :onchange => 'hostgroup_changed(this);' , :'data-host-id' => @host.id,
|
|
:'data-url' => @host.new_record? ? process_hostgroup_hosts_path : hostgroup_or_environment_selected_hosts_path ,
|
|||
017e1049 | Ohad Levy | :help_inline => image_tag('spinner.gif', :id => 'hostgroup_indicator', :class => 'hide').html_safe } %>
|
|
331e9bce | Ohad Levy | <%= select_f f, :environment_id, Environment.all, :id, :to_label, { :include_blank => true },
|
|
298756ca | Amos Benari | {:onchange => 'update_puppetclasses(this);', :'data-url' => hostgroup_or_environment_selected_hosts_path,
|
|
:'data-host-id' => @host.id} %>
|
|||
ace6fbad | Ohad Levy | <%= puppet_master_fields f %>
|
|
76702262 | Amos Benari | </div>
|
|
05ab4c16 | Ohad Levy | ||
82e47ae0 | Amos Benari | <div class="tab-pane" id="puppet_klasses">
|
|
919ffc50 | Ohad Levy | <% if @environment or @hostgroup -%>
|
|
dad78fb6 | Paul Kelly | <%= render 'puppetclasses/class_selection', :obj => @host %>
|
|
<% else -%>
|
|||
82e47ae0 | Amos Benari | <p class="alert alert-message">Please select an Environment first</p>
|
|
dad78fb6 | Paul Kelly | <% end -%>
|
|
</div>
|
|||
b09b4515 | Ohad Levy | ||
05ab4c16 | Ohad Levy | <%= f.hidden_field :managed %>
|
|
ff217463 | Amos Benari | <%= f.hidden_field :progress_report_id %>
|
|
b09b4515 | Ohad Levy | ||
05ab4c16 | Ohad Levy | <%= render('unattended', :f => f) if SETTINGS[:unattended] and @host.managed -%>
|
|
8deb9933 | Ohad Levy | ||
82e47ae0 | Amos Benari | <div class="tab-pane" id="params">
|
|
298756ca | Amos Benari | <h6>Puppet classes Parameters</h6>
|
|
<p></p>
|
|||
<%= render "puppetclasses/classes_parameters", { :obj => @host } %>
|
|||
995b1748 | Amos Benari | <h6>Included Parameters via inheritance</h6>
|
|
<p></p>
|
|||
298756ca | Amos Benari | <%= render "common_parameters/inherited_parameters", { :inherited_parameters => @host.host_inherited_params(true) } %>
|
|
995b1748 | Amos Benari | <h6>Host Parameters</h6>
|
|
<p></p>
|
|||
298756ca | Amos Benari | <%= render "common_parameters/puppetclasses_parameters", :f => f %>
|
|
<p></p>
|
|||
05ab4c16 | Ohad Levy | <%= render "common_parameters/parameters", { :f => f, :type => :host_parameters } %>
|
|
</div>
|
|||
b09b4515 | Ohad Levy | ||
82e47ae0 | Amos Benari | <div class="tab-pane" id="info">
|
|
05ab4c16 | Ohad Levy | <% if SETTINGS[:login] -%>
|
|
<%= selectable_f f, :is_owned_by, option_groups_from_collection_for_select(
|
|||
[User, Usergroup], :all, :table_name, :id_and_type, :select_title,
|
|||
@host.is_owned_by), { :include_blank => "select an owner" }, { :label => "Owned By" }
|
|||
%>
|
|||
<% end -%>
|
|||
<%= checkbox_f f, :enabled, :label => "Alerts Enabled",
|
|||
:help_inline => "Include this host within Foreman reporting"
|
|||
%>
|
|||
c8d89c66 | Amos Benari | <div id='model_name'>
|
|
<%= select_f f, :model_id, Model.all, :id, :to_label, { :include_blank => true }, {:label => "Hardware Model"} unless @host.compute_resource_id%>
|
|||
</div>
|
|||
82e47ae0 | Amos Benari | <%= textarea_f f, :comment, :help_block => "Additional information about this host", :class => "input-xxlarge", :rows => "3" %>
|
|
8deb9933 | Ohad Levy | </div>
|
|
611f5bff | Amos Benari | ||
05ab4c16 | Ohad Levy | </div>
|
|
611f5bff | Amos Benari | ||
30ae12bf | Ohad Levy | <%= f.hidden_field :overwrite? %>
|
|
<%= submit_or_cancel f, @host.overwrite? %>
|
|||
76702262 | Amos Benari | <% end %>
|