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

Storage: Fixed the process_button method to render the page correctly #305

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 13 additions & 7 deletions vmdb/app/controllers/cim_instance_controller.rb
Expand Up @@ -56,12 +56,17 @@ def process_button
"#{pfx}_retire","#{pfx}_protect","#{pfx}_ownership","#{pfx}_right_size",
"#{pfx}_refresh", "#{pfx}_reconfigure", "storage_tag"].include?(params[:pressed]) &&
@flash_array == nil

if !["host_edit","#{pfx}_edit","#{pfx}_miq_request_new","#{pfx}_clone","#{pfx}_migrate","#{pfx}_publish"].include?(params[:pressed])
@refresh_div = "main_div"
@refresh_partial = "layouts/gtl"
show # Handle EMS buttons
end
end
params[:page] = @current_page if @current_page.present? # Save current page for list refresh
unless ["host_edit",
"#{pfx}_edit",
"#{pfx}_miq_request_new",
"#{pfx}_clone",
"#{pfx}_migrate",
"#{pfx}_publish"].include?(params[:pressed])
@refresh_div = "main_div"
@refresh_partial = "layouts/gtl"
show # Handle EMS buttons
end
else
tag(self.class.model) if params[:pressed] == button_name("tag")
Expand Down Expand Up @@ -115,7 +120,8 @@ def process_button
else
if ["vms","hosts","storages"].include?(@display) # If displaying vms, action_url s/b show
page << "miqReinitToolbar('center_tb');"
page.replace_html("main_div", :partial=>"layouts/gtl", :locals=>{:action_url=>"show/#{@ems.id}"})
page.replace_html("main_div", :partial => "layouts/gtl",
:locals => {:action_url => "show/#{@record.id}"})
else
page.replace_html(@refresh_div, :partial=>@refresh_partial)
end
Expand Down