forked from theforeman/foreman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_base.html.erb
27 lines (21 loc) · 1.58 KB
/
_base.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
<%= javascript_tag("$(document).on('ContentLoad', tfm.numFields.initAll)"); %>
<%= text_f f, :name, :label => _('Name'), :label_size => "col-md-2", :disabled => !new_host if show_vm_name? %>
<%= counter_f f, :cpus, :disabled => !new_host, :label => _('CPUs'), :label_size => 'col-md-2', :'data-soft-max' => compute_resource.max_cpu_count %>
<%= byte_size_f f, :memory, :disabled => !new_host, :label => _('Memory'), :label_size => "col-md-2", :'data-soft-max' => compute_resource.max_memory %>
<!--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'), :label_size => "col-md-2"} if new_host && controller_name != "compute_attributes" %>
<%
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? || (params[:host] && params[:host][:provision_method] == 'build'),
:'data-url' => template_selected_compute_resource_path(compute_resource),
:onchange => 'libvirt_image_selected(this);',
:help_inline => :indicator,
:help_block => _("Image to use"),
:label => _('Image'), :label_size => "col-md-2"} %>
</div>
<%= compute_specific_js(compute_resource, "nic_info") %>