diff --git a/app/helpers/proxmox_vm_attrs_helper.rb b/app/helpers/proxmox_vm_attrs_helper.rb index 539957e87..9283e62b1 100644 --- a/app/helpers/proxmox_vm_attrs_helper.rb +++ b/app/helpers/proxmox_vm_attrs_helper.rb @@ -114,11 +114,11 @@ def additional_attrs(vms, param_scope, start_checked) start_after_create: vms.start_after_create, templated: vms.templated, } - vms_keys = [:pool, :start_after_create] + vms_keys = [:cpu_type, :nameserver, :searchdomain, :hostname] extra_attrs = ActiveSupport::HashWithIndifferentAccess.new attributes.each do |key, value| camel_key = key.to_s.include?('_') ? snake_to_camel(key.to_s).to_sym : key - nested_key = vms_keys.include?(key) ? key : "config_attributes[#{key}]" + nested_key = vms_keys.include?(key) ? "config_attributes[#{key}]" : key value = start_checked if key == :start_after_create extra_attrs[camel_key] = { name: "#{param_scope}[#{nested_key}]", value: value } end diff --git a/app/models/foreman_fog_proxmox/proxmox_interfaces.rb b/app/models/foreman_fog_proxmox/proxmox_interfaces.rb index 9d98125a5..098cd5c8e 100644 --- a/app/models/foreman_fog_proxmox/proxmox_interfaces.rb +++ b/app/models/foreman_fog_proxmox/proxmox_interfaces.rb @@ -118,7 +118,7 @@ def dhcp?(nic_compute_attributes, v6 = false) def set_mac(nic_compute_attributes, mac, type) mac_attr_name = { 'qemu' => :macaddr, 'lxc' => :hwaddr } mac_key = mac_attr_name[type] || 'mac' - nic_compute_attributes[mac_key] = Net::Validations.normalize_mac(mac) + nic_compute_attributes[mac_key] = mac.upcase end def host_interfaces_attrs(host) diff --git a/app/views/compute_resources_vms/form/proxmox/_add_react_component_to_host_form.html.erb b/app/views/compute_resources_vms/form/proxmox/_add_react_component_to_host_form.html.erb index bff607c1f..5d48d85f2 100644 --- a/app/views/compute_resources_vms/form/proxmox/_add_react_component_to_host_form.html.erb +++ b/app/views/compute_resources_vms/form/proxmox/_add_react_component_to_host_form.html.erb @@ -1,5 +1,4 @@ <% content_for(:javascripts) do %> <%= webpacked_plugins_js_for :foreman_fog_proxmox %> - <%= javascript_include_tag 'foreman_fog_proxmox/proxmox_vm', "data-turbolinks-track" => true %> <% end %> <%= react_component('ProxmoxVmType', { registerComp: true }) unless @host.managed %> diff --git a/webpack/components/GeneralTabContent.js b/webpack/components/GeneralTabContent.js index 90484c198..87d13b6eb 100644 --- a/webpack/components/GeneralTabContent.js +++ b/webpack/components/GeneralTabContent.js @@ -22,7 +22,7 @@ const GeneralTabContent = ({ required type="number" value={general?.vmid?.value} - disabled={fromProfile} + disabled={!newVm || fromProfile} onChange={handleChange} /> { name={opts?.ostype?.name} label={__('OS Type')} type="select" - options={ProxmoxComputeSelectors.proxmoxOperatingSystemsMap} + options={ProxmoxComputeSelectors.proxmoxOstypesMap} value={opts?.ostype?.value} onChange={handleChange} /> diff --git a/webpack/components/ProxmoxServer/components/HardDisk.js b/webpack/components/ProxmoxServer/components/HardDisk.js index 97e86048d..40db858ec 100644 --- a/webpack/components/ProxmoxServer/components/HardDisk.js +++ b/webpack/components/ProxmoxServer/components/HardDisk.js @@ -85,6 +85,12 @@ const HardDisk = ({ value={hdd?.id?.value} onChange={handleChange} /> +