|
|
|
<% nat = compute_resource.networks %>
|
|
<% bridges = compute_resource.bridges %>
|
|
|
|
<%= selectable_f f, :type, libvirt_networks(compute_resource), {},
|
|
{ :label => _('Network type'),
|
|
:disabled => !new_host,
|
|
:onchange => 'libvirt_network_selected(this)',
|
|
: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 => "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 bridges.any? %>
|
|
<%= selectable_f f, :bridge, bridges.map(&:name),
|
|
{ :include_blank => bridges.any? ? false : _("No bridges") },
|
|
{ :class => "libvirt_bridge without_select2", :label => _("Network"), :disabled => !new_host, :label_size => "col-md-3" } %>
|
|
<% else %>
|
|
<%= text_f f, :bridge,
|
|
:class => "libvirt_bridge",
|
|
:label => _("Network"),
|
|
:help_inline => popover(
|
|
'',
|
|
_('There was no active bridge interface found in libvirt, if it does not support listing, you can enter the bridge name manually (e.g. br0)'),
|
|
:rel => 'popover-modal'
|
|
),
|
|
: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 => 'without_select2', :disabled => !new_host, :label_size => "col-md-3" } %>
|