Skip to content

Commit

Permalink
fixup host compute attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha15 committed Jul 15, 2024
1 parent a0897d3 commit cc180d3
Show file tree
Hide file tree
Showing 14 changed files with 36,464 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

# You should have received a copy of the GNU General Public License
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

Deface::Override.new(
:virtual_path => 'hosts/_unattended',
:name => 'add_from_profile_to_compute',
:replace => "erb[loud]:contains('hosts/compute')",
:partial => 'compute_resources_vms/form/proxmox/add_from_profile_to_hosts_compute_form',
virtual_path: 'hosts/_form',
name: 'add_react_component_to_virtual_machine_tab',
insert_after: "li.active",
partial: 'compute_resources_vms/form/proxmox/add_react_component_to_host_form',
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Deface::Override.new(
:virtual_path => 'hosts/_compute',
:name => 'update_react_component_to_virtual_machine_tab',
:replace => "erb[loud]:contains('hosts/compute_detail')",
:partial => 'compute_resources_vms/form/proxmox/update_react_component_to_host_form',
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
<%= webpacked_plugins_js_for :foreman_fog_proxmox %>
<%= javascript_include_tag 'foreman_fog_proxmox/proxmox_vm', "data-turbolinks-track" => true %>
<% end %>
<%logger.warn("***********************8 i am here with host compute resource #{@host.compute_resource}")%>
<%= react_component('ProxmoxVmType') %>
12 changes: 10 additions & 2 deletions app/views/compute_resources_vms/form/proxmox/_base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
arch ||= nil ; os ||= nil
images = possible_images(compute_resource, arch, os)
-%>
<div id='image_selection'>
<%= select_f f, :image_id, images, :uuid, :name, { :include_blank => true },
:disabled => true,
:help_inline => :indicator,
:class => ('hide' if from_profile),
:label => _('Image'),
:label_size => "col-md-2" %>
</div>
<% end %>
<% content_for(:javascripts) do %>
<%= webpacked_plugins_js_for :foreman_fog_proxmox %>
Expand All @@ -28,5 +36,5 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
<% node_id = f.object.node_id %>
<% bridges = compute_resource.bridges(node_id) %>
<% volids = compute_resource.images_by_storage(node_id, 'local', 'iso') %>
<% logger.warn("******************** images are #{images.as_json}")%>
<%= react_component('ProxmoxVmType', { vm_attributes: object_to_attributes_hash(f.object, true), nodes: nodes, images: images.as_json, pools: compute_resource.pools, storages: compute_resource.storages, from_profile: true, new_vm: new_vm, bridges: bridges, volids: volids}) %>
<%logger.warn("************************** cloudinit added #{f.object.cloud_init?}")%>
<%= react_component('ProxmoxVmType', { vm_attributes: object_to_attributes_hash(f.object, from_profile), nodes: nodes, images: images.as_json, pools: compute_resource.pools, storages: compute_resource.storages, from_profile: from_profile, new_vm: new_vm, bridges: bridges, volids: volids, hasCloudinit: f.object.cloud_init? }) %>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License
along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>

<% if compute_resource.class == ForemanFogProxmox::Proxmox %>
<% logger.warn("*******************^^^^^^^^^^^^^^^^^^^^^^^^^^ I am after compute resource selection #{compute_resource}")%>
<%= render :partial => provider_partial(compute_resource, 'base'),
locals: { f: compute, host: host, compute_resource: compute_resource, new_host: host.new_record?, new_vm: !compute.object.persisted?,
arch: host.architecture_id, os: host.operatingsystem_id, from_profile: false } %>
Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_fog_proxmox/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Engine < ::Rails::Engine
assets_to_precompile =
Dir.chdir(root) do
Dir['app/assets/javascripts/foreman_fog_proxmox/**/*',
'app/assets/stylesheets/foreman_fog_proxmox/**/*'].map do |f|
'app/assets/stylesheets/foreman_fog_proxmox/**/*', 'webpack/**/*'].map do |f|
f.split(File::SEPARATOR, 4).last
end
end
Expand Down
Loading

0 comments on commit cc180d3

Please sign in to comment.