Skip to content

Commit

Permalink
cleanup rails view
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha15 committed Jun 21, 2024
1 parent 236c04e commit b87d960
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 43 deletions.
10 changes: 2 additions & 8 deletions app/helpers/proxmox_compute_selectors_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@

module ProxmoxComputeSelectorsHelper
def proxmox_types_map
[OpenStruct.new(id: 'qemu', value: 'qemu', name: 'KVM/Qemu server'),
OpenStruct.new(id: 'lxc', value: 'lxc', name: 'LXC container')]
end
def types_map
[
{key:1, value:'qemu', name: 'KVM/Qemu server'},
{key:2, value:'lxc', name: 'LXC container' }
]
[OpenStruct.new(id: 'qemu', name: 'KVM/Qemu server'),
OpenStruct.new(id: 'lxc', name: 'LXC container')]
end

def proxmox_archs_map
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
<% if @set.compute_resource.class == ForemanFogProxmox::Proxmox %>
<% logger.warn("****************** compute attribute form #{f2} #{f2.object}")%>
<%= render :partial => "compute_form",
:locals => { :f => f2, :compute_resource => @set.compute_resource, :selected_cluster => @set.vm_attrs['cluster'], :from_profile => true } %>
<% else %>
<%= render :partial => "compute_form",
:locals => { :f => f2, :compute_resource => @set.compute_resource, :selected_cluster => @set.vm_attrs['cluster'] } %>
<% end %>
<% end %>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
<% cloud_init = f.object.cloud_init? %>
<% logger.debug("_add_vm_type_to_volumes_edit.html cloud_init=#{cloud_init}") %>
<% container = type == 'lxc' %>

<%= add_child_link_typed '+ ' + _("Add Hard Disk"), :volumes, 'hard_disk', { :class => "info #{'hide' unless server }", :title => _('add new hard disk') } %>
<%= add_child_link_typed '+ ' + _("Add CD-ROM"), :volumes, 'cdrom', { :class => "info #{'hide' if cdrom }", :title => _('add new cd-rom') } %>
<%= add_child_link_typed '+ ' + _("Add Cloud-init"), :volumes, 'cloud_init', { :class => "info #{'hide' if cloud_init }", :title => _('add new cloud-init') } %>
<%= add_child_link_typed '+ ' + _("Add Mount Point"), :volumes, 'mp', { :class => "info #{'hide' unless container}", :title => _('add new mount point') } %>

<%= new_child_fields_template_typed(f, :volumes, {
:type => 'hard_disk',
:object => compute_resource.new_typed_volume({},'qemu','hard_disk'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
<% logger.debug("_volume_hard_disk.html f.object.hard_disk?=#{f.object.hard_disk?}") %>
<% logger.debug("_volume_hard_disk.html f.object.storage_type=#{f.object.storage_type}") %>
<% new_volume = f.object.volid.nil? %>

<%= field_set_tag _('Hard disk'), :id => "server_volume_hard_disk_#{f.index}", :class => ('hide' unless hard_disk), :disabled => !hard_disk do %>
<%= f.hidden_field :volid if !new_volume %>
<%= f.hidden_field :storage_type %>
Expand Down

0 comments on commit b87d960

Please sign in to comment.