theforeman/foreman-docker

View on GitHub
app/views/compute_resources_vms/form/_docker.html.erb

Summary

Maintainability
Test Coverage
<% javascript 'compute_resource', 'lookup_keys' %>
<%= text_f f, :name if show_vm_name? %>
<% new = @host.nil? || @host.try(:new_record?) %>
<%= select_f f, :image, compute_resource.images, :uuid, :name, {},
               {:help_inline => :indicator,
               :label       => _('Image') } %>
<%= f.hidden_field :template if !new %>

<div class='compute_profile'>
  <%= 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') %>
</div>
<%= text_f f, :cmd, :label => _('Command') %>
<% 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 && controller_name != "compute_attributes" %>