Project

General

Profile

« Previous | Next » 

Revision 1f71c494

Added by Tomer Brisker over 8 years ago

Fixes #12204 - Show interface form helptext in popovers

Refs #12204 - Resize interface modal, fields and labels

To cause virtual network settings to display correcty changes were also needed
in the layout of the compute attribute forms.

View differences:

app/assets/stylesheets/hosts.scss
font-size: 25px;
}
}
#interfaceModal .modal-dialog{
min-width: 600px;
}
app/helpers/hosts_helper.rb
active = 'Size'
active = 'None' if f.object.allocation.to_i == 0
active = 'Full' if f.object.allocation == f.object.capacity
text_f f, :allocation, :class => "input-mini", :label => _("Allocation (GB)"),
text_f f, :allocation, :class => "input-mini", :label => _("Allocation (GB)"), :label_size => "col-md-3",
:readonly => (active == 'Size') ? false : true,
:help_inline => (content_tag(:span, :class => 'btn-group', :'data-toggle' => 'buttons-radio') do
[N_('None'), N_('Size'), N_('Full')].collect do |label|
app/views/compute_attributes/_form.html.erb
<%= form_for([@set.compute_profile, @set]) do |f| %>
<%= base_errors_for @set %>
<%= select_f f, :compute_profile_id, ComputeProfile.all, :id, :name, {}, :disabled => true, :label => _('Compute profile') %>
<%= select_f f, :compute_resource_id, ComputeResource.all, :id, :to_label, {}, :disabled => true, :label => _('Compute resource') %>
<%= select_f f, :compute_profile_id, ComputeProfile.all, :id, :name, {}, :disabled => true, :label => _('Compute profile'), :label_size => "col-md-3" %>
<%= select_f f, :compute_resource_id, ComputeResource.all, :id, :to_label, {}, :disabled => true, :label => _('Compute resource'), :label_size => "col-md-3" %>
<%= fields_for 'compute_attribute[vm_attrs]', @set.compute_resource.new_vm(@set.vm_attrs) do |f2| %>
<%= render :partial => "compute_form",
app/views/compute_resources_vms/form/ec2/_base.html.erb
<%= select_f f, :flavor_id, compute_resource.flavors, :id, :to_label, {}, :label => _('Flavor') %>
<%= select_f f, :flavor_id, compute_resource.flavors, :id, :to_label, {}, :label => _('Flavor'), :label_size => "col-md-3" %>
<%
arch ||= nil ; os ||= nil
images = possible_images(compute_resource, arch, os)
%>
<div id='image_selection'><%= select_f f, :image_id, images, :uuid, :name,{:include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image')}, {:disabled => images.empty?, :label => _('Image')} %></div>
<div id='image_selection'><%= select_f f, :image_id, images, :uuid, :name,{:include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image')}, {:disabled => images.empty?, :label => _('Image'), :label_size => "col-md-3"} %></div>
<%= selectable_f f, :availability_zone, compute_resource.zones, {:include_blank => _("No preference")}, :label => _('Availability zone') %>
<%= selectable_f f, :availability_zone, compute_resource.zones, {:include_blank => _("No preference")}, :label => _('Availability zone'), :label_size => "col-md-3" %>
<div id='subnet_selection'>
<% if compute_resource.subnets.any? %>
<%= select_f f, :subnet_id, compute_resource.subnets, :subnet_id, :cidr_block,
{:include_blank => _("EC2")},
{:label => _("Subnet"), :onchange => "ec2_vpcSelected(this);"} %>
{:label => _("Subnet"), :label_size => "col-md-3", :onchange => "ec2_vpcSelected(this);"} %>
<% end %>
<%
vpc_id = compute_object_vpc_id(f)
if ( groups = security_groups_for_vpc(compute_resource.security_groups, vpc_id)) %>
<%= selectable_f f, :security_group_ids, groups, {},
{ :multiple => true, :label => _("Security groups"), :disabled => !(@host.nil? || @host.ip.empty?),
{ :multiple => true, :label => _("Security groups"), :label_size => "col-md-3", :disabled => !(@host.nil? || @host.ip.empty?),
:data => {
:security_groups => vpc_security_group_hash(compute_resource.security_groups),
:subnets => subnet_vpc_hash(compute_resource.subnets)
......
:class => 'security_group_ids' } %>
<% end %>
<%= selectable_f f, :managed_ip, {_("Public")=>'public', _("Private")=>'private'}, {}, { :label => _("Managed IP") } %>
<%= selectable_f f, :managed_ip, {_("Public")=>'public', _("Private")=>'private'}, {}, { :label => _("Managed IP"), :label_size => "col-md-3" } %>
</div>
app/views/compute_resources_vms/form/gce/_base.html.erb
<%= select_f f, :machine_type, compute_resource.flavors, :name, :name, {}, :label => _('Machine type') %>
<%= select_f f, :machine_type, compute_resource.flavors, :name, :name, {}, :label => _('Machine type'), :label_size => "col-md-3" %>
<%
arch ||= nil ; os ||= nil
images = possible_images(compute_resource, arch, os)
......
<div id='image_selection'>
<%= select_f f, :image_id, images, :uuid, :name,
{ :include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image') },
{ :disabled => images.empty?, :label => _('Image') } %>
{ :disabled => images.empty?, :label => _('Image'), :label_size => "col-md-3" } %>
</div>
<%= selectable_f f, :network, compute_resource.networks, {}, :label => _('Network') %>
<%= checkbox_f f, :external_ip, :label => _('External IP') %>
<%= selectable_f f, :network, compute_resource.networks, {}, :label => _('Network'), :label_size => "col-md-3" %>
<%= checkbox_f f, :external_ip, :label => _('External IP'), :label_size => "col-md-3" %>
app/views/compute_resources_vms/form/gce/_volume.html.erb
<%= text_f f, :size_gb, :class => "col-md-2", :label => _("Size (GB)"), :onchange => 'capacity_edit(this)' %>
<%= text_f f, :size_gb, :class => "col-md-2", :label => _("Size (GB)"), :label_size => "col-md-3", :onchange => 'capacity_edit(this)' %>
app/views/compute_resources_vms/form/libvirt/_base.html.erb
<%= text_f f, :name, :label => _('Name'), :disabled => !new_host if show_vm_name? %>
<%= selectable_f f, :cpus, 1..compute_resource.max_cpu_count, { }, :disabled => !new_host, :label => _('CPUs') %>
<%= selectable_f f, :memory, memory_options(compute_resource.max_memory), { }, :class => "col-md-2", :disabled => !new_host, :label => _('Memory') %>
<%= text_f f, :name, :label => _('Name'), :label_size => "col-md-3", :disabled => !new_host if show_vm_name? %>
<%= selectable_f f, :cpus, 1..compute_resource.max_cpu_count, { }, :disabled => !new_host, :label => _('CPUs'), :label_size => "col-md-3" %>
<%= selectable_f f, :memory, memory_options(compute_resource.max_memory), { }, :disabled => !new_host, :label => _('Memory'), :label_size => "col-md-3" %>
<!--TODO # Move to a helper-->
<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1' %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start')} if new_host && controller_name != "compute_attributes" %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start'), :label_size => "col-md-3"} if new_host && controller_name != "compute_attributes" %>
<%
arch ||= nil ; os ||= nil
......
:onchange => 'libvirt_image_selected(this);',
:help_inline => :indicator,
:help_block => _("Image to use"),
:label => _('Image')} %>
:label => _('Image'), :label_size => "col-md-3"} %>
</div>
<%= nic_info_js(compute_resource) %>
app/views/compute_resources_vms/form/libvirt/_network.html.erb
{ :label => _('Network type'),
:disabled => !new_host,
:onchange => 'libvirt_network_selected(this)',
:class => 'libvirt_network without_select2'
:class => 'libvirt_network without_select2',
:label_size => "col-md-3"
} %>
<div id='nat' class='<%= 'hide' if f.object.type != 'network' %>'>
<%= selectable_f f, :network, nat.map(&:name),
{ :include_blank => nat.any? ? false : _("No networks") },
{ :class => "col-md-2 libvirt_nat without_select2", :label => _("Network"), :disabled => (f.object.type != 'network' || !new_host) } %>
{ :class => "libvirt_nat without_select2", :label => _("Network"), :disabled => (f.object.type != 'network' || !new_host), :label_size => "col-md-3" } %>
</div>
<div id='bridge' class='<%= 'hide' if f.object.type && (f.object.type != 'bridge') %>'>
<% if bridge.any? %>
<%= selectable_f f, :bridge, bridge.map(&:name),
{ :include_blank => bridge.any? ? false : _("No bridges") },
{ :class => "col-md-2 libvirt_bridge without_select2", :label => _("Network"), :disabled => ((f.object.type && (f.object.type != 'bridge')) || !new_host) } %>
{ :class => "libvirt_bridge without_select2", :label => _("Network"), :disabled => ((f.object.type && (f.object.type != 'bridge')) || !new_host), :label_size => "col-md-3" } %>
<% else %>
<%= text_f f, :bridge, :class => "col-md-2 libvirt_bridge", :label => _("Network"), :help_block => _("your libvirt host does not support interface listing, please enter here the bridge name (e.g. br0)"), :disabled => !new_host %>
<%= text_f f, :bridge, :class => "libvirt_bridge", :label => _("Network"), :help_block => _("your libvirt host does not support interface listing, please enter here the bridge name (e.g. br0)"), :disabled => !new_host, :label_size => "col-md-3" %>
<% end %>
</div>
<%= selectable_f f, :model, %w(virtio rtl8139 ne2k_pci pcnet e1000), {},
{ :label => _('NIC type'), :class => 'col-md-2 without_select2', :disabled => !new_host } %>
{ :label => _('NIC type'), :class => 'without_select2', :disabled => !new_host, :label_size => "col-md-3" } %>
app/views/compute_resources_vms/form/libvirt/_volume.html.erb
<%= selectable_f f, :pool_name, compute_resource.storage_pools.map(&:name), { }, :class => "col-md-2 without_select2", :label => _("Storage pool") %>
<%= text_f f, :capacity, :class => "col-md-2", :label => _("Size (GB)"), :onchange => 'capacity_edit(this)' %>
<%= selectable_f f, :pool_name, compute_resource.storage_pools.map(&:name), { }, :class => "without_select2", :label => _("Storage pool"), :label_size => "col-md-3" %>
<%= text_f f, :capacity, :label => _("Size (GB)"), :onchange => 'capacity_edit(this)', :label_size => "col-md-3" %>
<%= allocation_text_f f %>
<%= select_f f, :format_type, %w[RAW QCOW2],:downcase, :to_s, { }, :class => "col-md-2 without_select2", :label => _("Type") %>
<%= select_f f, :format_type, %w[RAW QCOW2],:downcase, :to_s, { }, :class => "without_select2", :label => _("Type"), :label_size => "col-md-3" %>
app/views/compute_resources_vms/form/openstack/_base.html.erb
<%= text_f f, :name, :label => _('Name'), :disabled => !new_host if show_vm_name? %>
<%= select_f f, :flavor_ref, compute_resource.flavors, :id, :name, {}, :label => _('Flavor') %>
<%= text_f f, :name, :label => _('Name'), :label_size => "col-md-3", :disabled => !new_host if show_vm_name? %>
<%= select_f f, :flavor_ref, compute_resource.flavors, :id, :name, {}, :label => _('Flavor'), :label_size => "col-md-3" %>
<%
arch ||= nil ; os ||= nil
images = possible_images(compute_resource, arch, os)
%>
<%= selectable_f f, :availability_zone, compute_resource.zones, {:include_blank => _("No preference")}, :label => _('Availability zone') %>
<%= selectable_f f, :availability_zone, compute_resource.zones, {:include_blank => _("No preference")}, :label => _('Availability zone'), :label_size => "col-md-3" %>
<div id='image_selection'>
<%= select_f f, :image_ref, images, :uuid, :name,
{ :include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image') },
{ :disabled => images.empty?, :label => _("Image") } %>
{ :disabled => images.empty?, :label => _("Image"), :label_size => "col-md-3" } %>
</div>
<%= select_f f, :tenant_id, compute_resource.tenants, :id, :name, {}, :label => _('Tenant') %>
<%= select_f f, :tenant_id, compute_resource.tenants, :id, :name, {}, :label => _('Tenant'), :label_size => "col-md-3" %>
<%= select_f f, :security_groups, compute_resource.security_groups, :name, :name, {}, :label => _("Security group") %>
<%= select_f f, :security_groups, compute_resource.security_groups, :name, :name, {}, :label => _("Security group"), :label_size => "col-md-3" %>
<%= select_f f, :nics, compute_resource.internal_networks, :id, :name,
{}, { :label => _('Internal network'), :multiple => true } %>
<%= selectable_f f, :network, compute_resource.address_pools, { :prompt => "None" }, { :label => _("Floating IP network") } %>
<%= checkbox_f f, :boot_from_volume, {:label => _("Boot from volume"), :help_inline => _("Create new boot volume from image")}, "true", "false" %>
<%= text_f f, :size_gb, { :label => _("New boot volume size (GB)"), :help_inline => _("Defaults to image size if left blank") } %>
{}, { :label => _('Internal network'), :label_size => "col-md-3", :multiple => true } %>
<%= selectable_f f, :network, compute_resource.address_pools, { :prompt => "None" }, { :label => _("Floating IP network"), :label_size => "col-md-3" } %>
<%= checkbox_f f, :boot_from_volume, {:label => _("Boot from volume"), :label_size => "col-md-3", :help_inline => _("Create new boot volume from image")}, "true", "false" %>
<%= text_f f, :size_gb, { :label => _("New boot volume size (GB)"), :label_size => "col-md-3", :help_inline => _("Defaults to image size if left blank") } %>
app/views/compute_resources_vms/form/ovirt/_base.html.erb
<% javascript 'compute_resource', 'lookup_keys' %>
<%= text_f f, :name, :label => _('Name') if show_vm_name? %>
<%= text_f f, :name, :label => _('Name'), :label_size => "col-md-3" if show_vm_name? %>
<% clusters = compute_resource.clusters %>
<%= select_f f, :cluster, clusters, :id, :name, { },
{ :disabled => !new_host, :'data-url' => cluster_selected_compute_resource_path(compute_resource),
:onchange => 'ovirt_clusterSelected(this);',
:help_inline => :indicator,
:label => _('Cluster') } %>
:label => _('Cluster'), :label_size => "col-md-3" } %>
<%= f.hidden_field :cluster if !new_host %>
<%= select_f f, :template, compute_resource.templates, :id, :full_name, {:include_blank => _("Select template")},
{ :disabled => !new_host, :'data-url' => template_selected_compute_resource_path(compute_resource),
:onchange => 'ovirt_templateSelected(this);',
:help_inline => :indicator,
:help_block => _("oVirt/RHEV template to use"),
:label => _('Template') } %>
:label => _('Template'), :label_size => "col-md-3" } %>
<%= f.hidden_field :template if !new_host %>
<% selected_cluster ||= params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:cluster] %>
<%= selectable_f f, :cores, 1..compute_resource.max_cpu_count, { }, :class => "col-md-2", :label => _('Cores') %>
<%= selectable_f f, :memory, memory_options(compute_resource.max_memory), { }, :class => "col-md-2", :label => _('Memory') %>
<%= selectable_f f, :cores, 1..compute_resource.max_cpu_count, { }, :class => "col-md-2", :label => _('Cores'), :label_size => "col-md-3" %>
<%= selectable_f f, :memory, memory_options(compute_resource.max_memory), { }, :class => "col-md-2", :label => _('Memory'), :label_size => "col-md-3" %>
<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1' %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start') } if new_host && controller_name != "compute_attributes" %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start'), :label_size => "col-md-3" } if new_host && controller_name != "compute_attributes" %>
<%
arch ||= nil ; os ||= nil
......
:onchange => 'ovirt_templateSelected(this);',
:help_inline => :indicator,
:help_block => _("Image to use"),
:label => _('Image')} %>
:label => _('Image'), :label_size => "col-md-3"} %>
</div>
<%= nic_info_js(compute_resource) %>
app/views/compute_resources_vms/form/ovirt/_network.html.erb
<%= text_f f, :name, :disabled => !new_host, :class => "ovirt_name", :label => _('Name') %>
<%= text_f f, :name, :disabled => !new_host, :class => "ovirt_name", :label => _('Name'), :label_size => "col-md-3" %>
<% selected_cluster ||= compute_resource.clusters.first.id %>
<%= select_f f, :network, compute_resource.networks(selected_cluster ? { :cluster_id => selected_cluster } : { }), :id, :name,
{ }, :disabled => !new_host, :class => "ovirt_network without_select2",
:label => _('Network') %>
:label => _('Network'), :label_size => "col-md-3" %>
app/views/compute_resources_vms/form/ovirt/_volume.html.erb
<%= text_f f,:size_gb, :label => _('Size (GB)'), :disabled => !new_host, :class => "col-md-2" %>
<%= text_f f,:size_gb, :label => _('Size (GB)'), :label_size => "col-md-3", :disabled => !new_host, :class => "col-md-2" %>
<%= f.hidden_field :size_gb if !new_host %>
<%= select_f f, :storage_domain, compute_resource.storage_domains, :id, :name,
{ }, :label => _('Storage domain'), :disabled => !new_host, :class => "col-md-2 without_select2" %>
{ }, :label => _('Storage domain'), :label_size => "col-md-3", :disabled => !new_host, :class => "col-md-2 without_select2" %>
<%= f.hidden_field :storage_domain if !new_host %>
<%= f.hidden_field :id %>
<%= checkbox_f f, :preallocate, { :checked => false, :help_inline => _('Uses thin provisioning if unchecked'), :label => _('Preallocate disk') } %>
<%= checkbox_f f, :preallocate, { :checked => false, :help_inline => _('Uses thin provisioning if unchecked'), :label => _('Preallocate disk'), :label_size => "col-md-3" } %>
<%= field(f, :bootable, :label => _('Bootable')) do
<%= field(f, :bootable, :label => _('Bootable'), :label_size => "col-md-3") do
radio_button_f f, :bootable, {:disabled => !new_host, :value=>'true', :checked => (f.object.bootable == 'true'), :onclick => 'bootable_radio(this)',
:text => _('Only one volume can be bootable')}
end %>
app/views/compute_resources_vms/form/rackspace/_base.html.erb
<%= select_f f, :flavor_id, compute_resource.flavors, :id, :name, {}, {:label => _('Flavor'), :class => 'without_select2'} %>
<%= select_f f, :flavor_id, compute_resource.flavors, :id, :name, {}, {:label => _('Flavor'), :label_size => "col-md-3", :class => 'without_select2'} %>
<%
arch ||= nil ; os ||= nil
images = possible_images(compute_resource, arch, os)
......
<div id='image_selection'>
<%= select_f f, :image_id, images, :uuid, :name, {:include_blank => (images.empty? || images.size == 1) ? false : _('Please Select an Image')},
{:disabled => images.empty?, :label => _('Image'), :class => 'without_select2'} %>
{:disabled => images.empty?, :label => _('Image'), :label_size => "col-md-3", :class => 'without_select2'} %>
</div>
app/views/compute_resources_vms/form/vmware/_base.html.erb
<%= text_f f, :name, :label => _('Name'), :disabled => !new_host if show_vm_name? %>
<%= selectable_f f, :cpus, 1..compute_resource.max_cpu_count, { }, :class => "col-md-2", :disabled => !new_host, :label => _('CPUs') %>
<%= selectable_f f, :corespersocket, 1..compute_resource.max_cpu_count, { }, :class => "col-md-2", :disabled => !new_host, :label => _('Cores per socket') %>
<%= text_f f, :memory_mb, :class => "col-md-2", :disabled => !new_host, :label => _("Memory (MB)") %>
<%= selectable_f f, :cluster, compute_resource.clusters, { }, :class => "col-md-2", :disabled => !new_host, :label => _('Cluster') %>
<%= text_f f, :name, :label => _('Name'), :label_size => "col-md-3", :disabled => !new_host if show_vm_name? %>
<%= selectable_f f, :cpus, 1..compute_resource.max_cpu_count, { }, :class => "col-md-2", :disabled => !new_host, :label => _('CPUs'), :label_size => "col-md-3" %>
<%= selectable_f f, :corespersocket, 1..compute_resource.max_cpu_count, { }, :class => "col-md-2", :disabled => !new_host, :label => _('Cores per socket'), :label_size => "col-md-3" %>
<%= text_f f, :memory_mb, :class => "col-md-2", :disabled => !new_host, :label => _("Memory (MB)"), :label_size => "col-md-3" %>
<%= selectable_f f, :cluster, compute_resource.clusters, { }, :class => "col-md-2", :disabled => !new_host, :label => _('Cluster'), :label_size => "col-md-3" %>
<%# selectable_f f, :resource_pool, compute_resource.resource_pools, { }, :class => "col-md-2", :disabled => !new_host %>
<%= select_f f, :path, compute_resource.folders, :path, :to_label , {}, { :label => _("Folder"), :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :guest_id, compute_resource.guest_types, :first, :last, {}, { :label => _("Guest OS"), :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :scsi_controller_type, compute_resource.scsi_controller_types, :first, :last, {}, { :label => _("SCSI controller"), :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :hardware_version, compute_resource.vm_hw_versions, :first, :last, {}, { :label => _("Virtual H/W version"), :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :path, compute_resource.folders, :path, :to_label , {}, { :label => _("Folder"), :label_size => "col-md-3", :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :guest_id, compute_resource.guest_types, :first, :last, {}, { :label => _("Guest OS"), :label_size => "col-md-3", :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :scsi_controller_type, compute_resource.scsi_controller_types, :first, :last, {}, { :label => _("SCSI controller"), :label_size => "col-md-3", :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :hardware_version, compute_resource.vm_hw_versions, :first, :last, {}, { :label => _("Virtual H/W version"), :label_size => "col-md-3", :class => "col-md-2", :disabled => !new_host } %>
<!--TODO # Move to a helper-->
<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1' %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start') } if new_host and controller_name != 'compute_attributes' %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start'), :label_size => "col-md-3" } if new_host and controller_name != 'compute_attributes' %>
<%
arch ||= nil ; os ||= nil
......
<div id='image_selection'>
<%= select_f f, :image_id, images, :uuid, :name,
{ :include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image') },
{ :disabled => images.empty?, :label => _('Image') } %>
{ :disabled => images.empty?, :label => _('Image'), :label_size => "col-md-3" } %>
</div>
<%= nic_info_js(compute_resource) %>
app/views/compute_resources_vms/form/vmware/_network.html.erb
<% networks = compute_resource.networks %>
<%= select_f f, :type, compute_resource.nictypes, :first, :last, { },
:class => "col-md-2 vmware_type without_select2",
:label => _('NIC type')
:label => _('NIC type'), :label_size => "col-md-3"
%>
<%= select_f f, :network, networks, :name, :name, { },
:class => "col-md-2 vmware_network without_select2",
:label => _('Network')
:label => _('Network'), :label_size => "col-md-3"
%>
app/views/compute_resources_vms/form/vmware/_volume.html.erb
<%= selectable_f f, :datastore, vsphere_datastores(compute_resource), { }, :class => "span5 without_select2", :label => _("Data store") %>
<%= text_f f, :name, :class => "col-md-2", :label => _("Name") %>
<%= selectable_f f, :datastore, vsphere_datastores(compute_resource), { }, :class => "span5 without_select2", :label => _("Data store"), :label_size => "col-md-3" %>
<%= text_f f, :name, :class => "col-md-2", :label => _("Name"), :label_size => "col-md-3" %>
<%= text_f f, :size_gb,
:class => "col-md-2",
:label => _("Size (GB)") %>
:label => _("Size (GB)"), :label_size => "col-md-3" %>
<%= checkbox_f f, :thin, {
:label => _("Thin provision")},
:label => _("Thin provision"), :label_size => "col-md-3"},
"true",
"false" %>
<%= checkbox_f f, :eager_zero, {
:label => _("Eager zero")},
:label => _("Eager zero"), :label_size => "col-md-3"},
"true",
"false" %>
app/views/nic/_base_form.html.erb
<%= selectable_f f, :type, interfaces_types, {},
:class => 'interface_type without_select2', :disabled => !f.object.new_record? %>
:class => 'interface_type without_select2',
:disabled => !f.object.new_record?,
:size => "col-md-8", :label_size => "col-md-3" %>
<%= text_f f, :mac, :class => :interface_mac %>
<%= text_f f, :mac, :class => :interface_mac, :size => "col-md-8", :label_size => "col-md-3" %>
<%= text_f f, :identifier,
:help_inline => popover(
_("Device identifier"),
:label => _("Device identifier"),
:help_inline => popover('',
_("Device identifier for this interface. This may be different on various platforms and environments, here are some common examples.<br/><ul>" +
"<li>Use the basic name for physical interface identifiers, e.g. <strong>eth0</strong> or <strong>em0</strong> with biosdevname.</li>" +
"<li>For virtual interfaces, use either alias notation (<strong>eth0:1</strong>, name:index) or VLAN notation (<strong>eth0.15</strong>, name.tag).</li>" +
"<li>For bonds it's common to use <strong>bond0</strong> on Linux, <strong>lagg0</strong> on FreeBSD systems.</li></ul>"),
:title => _("Device identifier"),
:rel => 'popover-modal',
:'data-placement' => "top"
),
:class => :interface_identifier %>
:class => :interface_identifier,
:size => "col-md-8", :label_size => "col-md-3" %>
<%= text_f f, :name, :label => _("DNS name"), :value => f.object.shortname,
:help_inline => _("Primary interface's DNS name and domain define host's FQDN"),
:class => :interface_name %>
:help_inline => popover('', _("Primary interface's DNS name and domain define host's FQDN"), :rel => 'popover-modal'),
:class => :interface_name,
:size => "col-md-8", :label_size => "col-md-3" %>
<% if SETTINGS[:unattended] %>
<%= select_f f, :domain_id, accessible_domains, :id, :to_label,
{ :include_blank => accessible_domains.any? ? true : _("No domains")},
{ :disabled => accessible_domains.empty? ? true : false,
:help_inline => :indicator,
:class => 'interface_domain without_select2', :'data-url' => domain_selected_hosts_path } %>
:class => 'interface_domain without_select2', :'data-url' => domain_selected_hosts_path,
:size => "col-md-8", :label_size => "col-md-3" } %>
<%= select_f f, :subnet_id, accessible_subnets, :id, :to_label,
{ :include_blank => accessible_subnets.any? ? true : _("No subnets")},
{ :disabled => accessible_subnets.empty? ? true : false,
:help_inline => :indicator,
:class => 'interface_subnet without_select2', :'data-url' => freeip_subnets_path } %>
:class => 'interface_subnet without_select2', :'data-url' => freeip_subnets_path,
:size => "col-md-8", :label_size => "col-md-3" } %>
<% end %>
<%= text_f f, :ip,
:class => :interface_ip,
:autocomplete => 'off',
:help_block => link_to(_("Suggest new"), '#', :class => 'suggest_new_ip'),
:help_inline => popover(
_("IP address auto-suggest"),
:help_inline => popover('',
_("An IP address will be auto-suggested if you have a DHCP-enabled Smart Proxy on the subnet selected above.<br/><br/>The IP address can be left blank when:<br/><ul><li>provisioning tokens are enabled</li><li>the domain does not manage DNS</li><li>the subnet does not manage reverse DNS</li><li>and the subnet does not manage DHCP reservations</li></ul>"),
:title => _("IP address auto-suggest"),
:rel => 'popover-modal',
:'data-placement' => "top"
).html_safe %>
).html_safe,
:size => "col-md-8", :label_size => "col-md-3" %>
<% if SETTINGS[:unattended] %>
<%= checkbox_f f, :managed,
:help_inline => _("Should this interface be managed via DHCP and DNS smart proxy and should it be configured during provisioning?") %>
:help_inline => popover('',_("Should this interface be managed via DHCP and DNS smart proxy and should it be configured during provisioning?"), :rel => 'popover-modal'),
:size => "col-md-8", :label_size => "col-md-3" %>
<% end %>
<%= checkbox_f f, :primary,
:help_inline => _("The Primary interface is used for constructing the FQDN of the host"),
:class => :interface_primary %>
:help_inline => popover('',_("The Primary interface is used for constructing the FQDN of the host"), :rel => 'popover-modal'),
:class => :interface_primary,
:size => "col-md-8", :label_size => "col-md-3" %>
<%= checkbox_f f, :provision,
:help_inline => _("The Provisioning interface is used for TFTP of PXELinux (or SSH for image-based hosts)"),
:class => :interface_provision %>
:help_inline => popover('',_("The Provisioning interface is used for TFTP of PXELinux (or SSH for image-based hosts)"), :rel => 'popover-modal'),
:class => :interface_provision,
:size => "col-md-8", :label_size => "col-md-3" %>
app/views/nic/_virtual_form.html.erb
<%= text_f f, :tag, :help_inline => _("Inherits from subnet VLAN ID if not set") %>
<%= text_f f, :attached_to, :help_inline => _("Identifier of the interface to which this interface belongs, e.g. eth1"),
:required => local_assigns[:attached_to_required], :class => 'attached' %>
<%= text_f f, :tag, :help_inline => popover('',_("Inherits from subnet VLAN ID if not set"), :rel => 'popover-modal'), :size => "col-md-8", :label_size => "col-md-3" %>
<%= text_f f, :attached_to, :help_inline => popover('',_("Identifier of the interface to which this interface belongs, e.g. eth1"), :rel => 'popover-modal'),
:required => local_assigns[:attached_to_required], :class => 'attached', :size => "col-md-8", :label_size => "col-md-3" %>
app/views/nic/bmcs/_bmc.html.erb
<%= render 'nic/base_form', :f => f %>
<%= content_tag :span, :id => 'bmc_fields' do %>
<%= text_f f, :username %>
<%= password_f f, :password, :unset => action_name == "edit"%>
<%= selectable_f f, :provider, Nic::BMC::PROVIDERS %>
<%= text_f f, :username, :size => "col-md-8", :label_size => "col-md-3" %>
<%= password_f f, :password, :unset => action_name == "edit", :size => "col-md-8", :label_size => "col-md-3" %>
<%= selectable_f f, :provider, Nic::BMC::PROVIDERS, {}, :size => "col-md-8", :label_size => "col-md-3" %>
<% end %>
<%= render 'nic/provider_specific_form', :f => f %>
app/views/nic/bonds/_bond.html.erb
<%= render 'nic/base_form', :f => f %>
<%= content_tag :span, :class => 'bond_fields' do %>
<%= selectable_f f, :mode, Nic::Bond::MODES %>
<%= text_f f, :attached_devices, :help_inline => _('comma separated interface identifiers'), :class => 'attached' %>
<%= text_f f, :bond_options, :help_inline => _('space separated options, e.g. miimon=100') %>
<%= selectable_f f, :mode, Nic::Bond::MODES, {}, :size => "col-md-8", :label_size => "col-md-3" %>
<%= text_f f, :attached_devices, :help_inline => popover('', _('comma separated interface identifiers'), :rel => 'popover-modal'), :class => 'attached', :size => "col-md-8", :label_size => "col-md-3" %>
<%= text_f f, :bond_options, :help_inline => popover('', _('space separated options, e.g. miimon=100'), :rel => 'popover-modal'), :size => "col-md-8", :label_size => "col-md-3" %>
<% end %>
<%= render 'nic/provider_specific_form', :f => f %>
app/views/nic/manageds/_managed.html.erb
<%= checkbox_f f, :virtual,
:disabled => !f.object.new_record?,
:label => _("Virtual NIC"),
:help_inline => _("Enable if this is an alias or VLAN interface, note that alias can be used only with static boot mode subnet"),
:class => 'virtual' %>
:help_inline => popover('',_("Enable if this is an alias or VLAN interface, note that alias can be used only with static boot mode subnet"), :rel => 'popover-modal'),
:class => 'virtual',
:size => "col-md-8", :label_size => "col-md-3" %>
<% hidden_class = f.object.virtual ? '' : 'hidden' %>
<%= content_tag :div, :class => "virtual_form #{hidden_class}" do %>

Also available in: Unified diff