Skip to content

Commit

Permalink
add physical server buttons when displaying through ems_physical_infra
Browse files Browse the repository at this point in the history
  • Loading branch information
MaysaMacedo committed Oct 16, 2017
1 parent 9d1fe36 commit 7ef5665
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions app/controllers/ems_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def edit
def button
@edit = session[:edit] # Restore @edit for adv search box

params[:display] = @display if ["vms", "hosts", "storages", "instances", "images", "orchestration_stacks"].include?(@display) # Were we displaying vms/hosts/storages
params[:display] = @display if ["vms", "hosts", "storages", "instances", "images", "orchestration_stacks", "physical_servers"].include?(@display) # Were we displaying vms/hosts/storages
params[:page] = @current_page unless @current_page.nil? # Save current page for list refresh

# Handle buttons from sub-items screen
Expand All @@ -192,7 +192,8 @@ def button
"orchestration_stack_",
"security_group_",
"storage_",
"vm_")
"vm_",
"physical_server_")

case params[:pressed]
# Clusters
Expand Down Expand Up @@ -232,6 +233,10 @@ def button
when "network_router_tag" then tag(NetworkRouter)
when "orchestration_stack_tag" then tag(OrchestrationStack)
when "security_group_tag" then tag(SecurityGroup)

when "physical_server_protect" then assign_policies(PhysicalServer)
when "physical_server_tag" then tag(PhysicalServer)

end

return if params[:pressed].include?("tag") && !%w(host_tag vm_tag miq_template_tag instance_tag).include?(params[:pressed])
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper/toolbar_chooser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ def center_toolbar_filename_classic
cloud_tenants cloud_volumes ems_clusters flavors floating_ips host_aggregates hosts
load_balancers network_ports network_routers orchestration_stacks resource_pools
security_groups storages middleware_deployments middleware_datasources
middleware_messagings middleware_servers)
to_display_center = %w(stack_orchestration_template topology cloud_object_store_objects)
middleware_messagings middleware_servers )
to_display_center = %w(stack_orchestration_template topology cloud_object_store_objects physical_servers)
if @lastaction == 'show' && (@view || @display != 'main') && !@layout.starts_with?("miq_request")
if @display == "vms" || @display == "all_vms"
return "vm_infras_center_tb"
Expand Down
4 changes: 4 additions & 0 deletions app/views/shared/views/ems_common/_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
- arr = (controller_name.camelize + "Controller").constantize.display_methods
- if arr.include?(@display) && @showtype != "compare"
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@ems.id}"}
- if %w(physical_servers).include?(@display)
%physical-server-toolbar#ems_physical_infra_show_list_form
:javascript
miq_bootstrap('#ems_physical_infra_show_list_form')
- elsif @showtype == "details"
= render(:partial => "layouts/gtl", :locals => {:action_url => @lastaction})
- elsif @showtype == "item"
Expand Down

0 comments on commit 7ef5665

Please sign in to comment.