Project

General

Profile

Download (3.28 KB) Statistics
| Branch: | Tag: | Revision:
<% form_for @host do |f| %>
<%= f.error_messages %>

<% field_set_tag 'Primary settings' do -%>
<div class="span-5">
<%= f.label :name %>
<%= f.text_field :name, :value => @host.shortname, :title => @host.to_s, :size => 12 %>
</div>
<div class="span-3">
<%= f.label :hostgroup_id, "Host group" %>
<%= image_tag "spinner.gif", :id => "indicator1", :style => "display:none;" %>
</div>
<%= f.collection_select(:hostgroup_id, accessible_hostgroups, :id, :to_label, { :include_blank => true },
{ :onchange => update_details_from_hostgroup, :class => "span-3" }) %>
<div class="span-6">
<%= f.label :environment_id %>
<%= f.collection_select :environment_id, Environment.all, :id, :to_label, { :include_blank => true } %>
</div>
<div class="span-6 last">
<%= puppetmaster_field(@host, f) %>
</div>
<br>
<div class ="span-4 last">
<%= link_to_function "Additional Classes", '$("#classlist").slideToggle();' %>
</div>
<br>
<div id="classlist" style="display:none;">
<% if @environment or @hostgroup -%>
<%= render 'puppetclasses/class_selection', :obj => @host %>
<% else -%>
<strong>Please select an Environment first</strong>
<% end -%>
</div>
<% end -%>

<%= observe_field(:host_hostgroup_id,
:url => { :action => :hostgroup_or_environment_selected, :id => @host.id },
:update => :classlist,
:with => "'hostgroup_id=' + value+'&environment_id='+$('#host_environment_id').attr('value')") unless @host.new_record? %>

<%= observe_field(:host_environment_id,
:url => { :action => :hostgroup_or_environment_selected, :id => @host.id },
:update => :classlist,
:with => "'environment_id=' + value+'&hostgroup_id='+$('#host_hostgroup_id').attr('value')") %>

<%= f.hidden_field :managed %>

<%= render('unattended', :f => f) if (SETTINGS[:unattended].nil? or SETTINGS[:unattended]) and @host.managed -%>

<%= render "common_parameters/parameters", { :f => f, :type => :host_parameters } %>

<% field_set_tag link_to_function("Additional Information", '$("#additional_info").slideToggle()') do %>
<div id="additional_info" style="display:none;">
<div class="span-10">
<br>
<% if true || SETTINGS[:login] -%>
<%= f.label :is_owned_by, "Owner", :class => "span-3" %>
<%= f.select( :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" }, { :class => "span-5 last" }) %>
<% end -%>

<div class="span-10 last" title="Include this host within Foreman reporting">
<%= f.label :enabled, "Alerts Enabled", :class => "span-3" %>
<%= f.check_box :enabled, :class => "span-5 last" %>
</div>
</div>
<%= f.label :comment, "Additional information about this host", :class => "span-14 last" %>
<%= f.text_area :comment, :size => "70x10", :title => "Additional information about this host", :class => "span-14 last" %>
</div>
<% end -%>

<%= f.submit "Submit" %>
<% end %>
(2-2/25)