%# Copyright 2018 Tristan Robert
This file is part of TheForemanProxmox.
TheForemanProxmox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
TheForemanProxmox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TheForemanProxmox. If not, see . %>
<%= javascript_include_tag 'the_foreman_proxmox/proxmox' %>
<%= javascript_tag("$(document).on('ContentLoad', tfm.numFields.initAll)"); %>
<%= field_set_tag _("General"), :id => "general" do %>
<%= checkbox_f f, :templated, :label => _('Create image?'), :disabled => new_vm || f.object.templated? %>
<%= counter_f f, :vmid, :label => _('VM ID'), :label_size => "col-md-2", :required => true, :disabled => !new_vm %>
<%= select_f f, :node, compute_resource.nodes, :node, :node, { }, :label => _('Node'), :label_size => "col-md-2", :required => true, :disabled => !new_vm %>
<% unless local_assigns[:hide_image] && !new_vm %>
<%
arch ||= nil ; os ||= nil
images = possible_images(compute_resource, arch, os)
-%>
<%= select_f f, :image_id, images, :uuid, :name, { :include_blank => true },
:disabled => true,
:help_inline => :indicator,
:label => _('Image'),
:label_size => "col-md-2" %>
<% end %>
<% end %>
<%= f.fields_for :config do |config_f|%>
<%= render :partial => 'compute_resources_vms/form/proxmox/config', :locals => { :f => config_f, :compute_resource => compute_resource, :host => @host, :new_vm => new_vm, :item_layout => 'removable' } %>
<% end %>