forked from theforeman/foreman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_ec2.html.erb
28 lines (23 loc) · 1.43 KB
/
_ec2.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<%= select_f f, :flavor_id, compute_resource.flavors, :id, :to_label, {}, :label => _('Flavor') %>
<%
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>
<%= selectable_f f, :availability_zone, compute_resource.zones, {:include_blank => _("No preference")}, :label => _('Availability zone') %>
<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);"} %>
<% 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?),
: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") } %>
</div>