Skip to content

Commit

Permalink
fix: fixes mac capitalize issue and react UI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha15 committed Jul 29, 2024
1 parent 00d7974 commit eac6fb6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/helpers/proxmox_vm_attrs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/foreman_fog_proxmox/proxmox_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %>
2 changes: 1 addition & 1 deletion webpack/components/GeneralTabContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const GeneralTabContent = ({
required
type="number"
value={general?.vmid?.value}
disabled={fromProfile}
disabled={!newVm || fromProfile}
onChange={handleChange}
/>
<InputField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ProxmoxContainerOptions = ({ options, storages, nodeId }) => {
name={opts?.ostype?.name}
label={__('OS Type')}
type="select"
options={ProxmoxComputeSelectors.proxmoxOperatingSystemsMap}
options={ProxmoxComputeSelectors.proxmoxOstypesMap}
value={opts?.ostype?.value}
onChange={handleChange}
/>
Expand Down
6 changes: 6 additions & 0 deletions webpack/components/ProxmoxServer/components/HardDisk.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ const HardDisk = ({
value={hdd?.id?.value}
onChange={handleChange}
/>
<input
name={hdd?.volid?.name}
type="hidden"
value={hdd?.volid?.value}
onChange={handleChange}
/>
<InputField
name={hdd?.storage?.name}
label={__('Storage')}
Expand Down
2 changes: 1 addition & 1 deletion webpack/components/common/FormInputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const InputField = ({
<select
disabled={disabled}
name={name}
className="form-control"
className="without_select2 form-control"
value={value}
onChange={onChange}
>
Expand Down

0 comments on commit eac6fb6

Please sign in to comment.