Project

General

Profile

Download (2.94 KB) Statistics
| Branch: | Tag: | Revision:
334d0359 Amos Benari
<% javascript 'compute_resource', 'lookup_keys' %>
c6e02bd3 Joseph Magen
<%= text_f f, :name if show_vm_name? %>
334d0359 Amos Benari
<% new = @host.nil? || @host.try(:new_record?) %>
<% clusters = compute_resource.clusters %>
<%= select_f f, :cluster, clusters, :id, :name, { },
{ :disabled => !new, :'data-url' => cluster_selected_compute_resource_path(compute_resource),
:onchange => 'ovirt_clusterSelected(this);',
a0c1773d Lukas Zapletal
:help_inline => :indicator,
:label => _('Cluster') } %>
334d0359 Amos Benari
<%= f.hidden_field :cluster if !new %>
c6e02bd3 Joseph Magen
<%= select_f f, :template, compute_resource.templates, :id, :name, {:include_blank => _("Select template")},
{ :disabled => !new, :'data-url' => template_selected_compute_resource_path(compute_resource),
:onchange => 'ovirt_templateSelected(this);',
89b9ecb0 Amos Benari
:help_inline => :indicator,
c6e02bd3 Joseph Magen
:help_block => _("Template / Compute Profile to use"),
a0c1773d Lukas Zapletal
:label => _('Template') } %>
334d0359 Amos Benari
<%= f.hidden_field :template if !new %>

c6e02bd3 Joseph Magen
<div class='compute_profile'>
bf4a13d3 Walden Raines
<%= 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') %>
334d0359 Amos Benari
<div class="children_fields">
<%= new_child_fields_template(f, :interfaces, {
:object => compute_resource.new_interface,
e170c321 Olivier Favre
:partial => 'compute_resources_vms/form/ovirt/network', :form_builder_attrs => { :clusters => clusters, :compute_resource => compute_resource } }) %>
4d4557e9 Joseph Magen
<%= field_set_tag _("Network interfaces"), :id => "network_interfaces", :title => _('Networks') do %>
334d0359 Amos Benari
<%= f.fields_for :interfaces do |i| %>
e170c321 Olivier Favre
<%= render 'compute_resources_vms/form/ovirt/network', :f => i, :clusters => clusters, :compute_resource => compute_resource %>
4d4557e9 Joseph Magen
<% end %>
bfbf7ed8 Lukas Zapletal
<%= add_child_link '+ ' + _("Add Interface"), :interfaces, { :class => "info", :title => _('add new network interface') } %>
4d4557e9 Joseph Magen
<% end %>
96ede451 Amos Benari
<%= new_child_fields_template(f, :volumes, {
:object => compute_resource.new_volume,
e170c321 Olivier Favre
:partial => 'compute_resources_vms/form/ovirt/volume', :form_builder_attrs => { :clusters => clusters, :compute_resource => compute_resource } }) %>
4d4557e9 Joseph Magen
<%= field_set_tag _("Volumes"), :id => "volumes", :title => _('Volumes') do %>
96ede451 Amos Benari
<%= f.fields_for :volumes do |i| %>
e170c321 Olivier Favre
<%= render 'compute_resources_vms/form/ovirt/volume', :f => i, :compute_resource => compute_resource %>
4d4557e9 Joseph Magen
<% end %>
bfbf7ed8 Lukas Zapletal
<%= add_child_link '+ ' + _("Add Volume"), :volumes, { :class => "info", :title => _('add new volume') } %>
4d4557e9 Joseph Magen
<% end %>
334d0359 Amos Benari
</div>
</div>
446fce67 Dominic Cleal
<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1' %>
c6e02bd3 Joseph Magen
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start') } if new && controller_name != "compute_attributes" %>