Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to associate individual vm to host #300

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/helpers/proxmox_compute_resources_vms_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def vm_power_action(vm, authorizer = nil)
end

def vm_associate_action(vm)
vm_associate_link(vm, link_class: "btn btn-default")
end

def vm_associate_link(vm, link_class: "")
return unless @compute_resource.supports_host_association?
display_link_if_authorized(
_('Associate VM'),
hash_for_associate_compute_resource_vm_path(
Expand All @@ -52,7 +57,7 @@ def vm_associate_action(vm)
),
:title => _('Associate VM to a Foreman host'),
:method => :put,
:class => 'btn btn-default'
:class => link_class
)
end

Expand Down
1 change: 1 addition & 0 deletions app/views/compute_resources_vms/index/_proxmox.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
<td>
<%= action_buttons(
vm_power_action(vm, authorizer),
vm_associate_link(vm),
display_delete_if_authorized(hash_for_compute_resource_vm_path(:compute_resource_id => @compute_resource, :id => vm.unique_cluster_identity(@compute_resource)).merge(:auth_object => @compute_resource, :authorizer => authorizer))) %>
</td>
</tr>
Expand Down
Loading