forked from ManageIQ/manageiq-ui-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seperate cloud and infra resource pools
- Loading branch information
1 parent
26ad824
commit 8534f7a
Showing
24 changed files
with
667 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,98 @@ | ||
class ResourcePoolInfraController < ResourcePoolController | ||
class ResourcePoolInfraController < ApplicationController | ||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
include Mixins::GenericButtonMixin | ||
include Mixins::GenericListMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::BreadcrumbsMixin | ||
|
||
def self.display_methods | ||
%w[vms all_vms resource_pools] | ||
end | ||
|
||
# handle buttons pressed on the button bar | ||
def button | ||
@edit = session[:edit] # Restore @edit for adv search box | ||
params[:display] = @display if %w[all_vms vms resource_pools].include?(@display) # Were we displaying sub-items | ||
@refresh_div = 'main_div' unless @display # Default div for button.rjs to refresh | ||
case params[:pressed] | ||
when 'resource_pool_delete' | ||
deleteresourcepools | ||
if @refresh_div == 'main_div' && @lastaction == 'show_list' | ||
replace_gtl_main_div | ||
else | ||
render_flash unless performed? | ||
end | ||
when 'resource_pool_protect' | ||
assign_policies(ResourcePool) | ||
else | ||
super | ||
end | ||
render_flash unless performed? | ||
end | ||
|
||
def self.model | ||
ResourcePool | ||
ManageIQ::Providers::InfraManager::ResourcePool | ||
end | ||
|
||
def self.table_name | ||
@table_name ||= "resource_pool" | ||
end | ||
|
||
def breadcrumb_name(_model) | ||
_("Infrastructure Resource Pools") | ||
end | ||
|
||
def download_data | ||
assert_privileges('resource_pool_infra_view') | ||
super | ||
end | ||
|
||
def download_summary_pdf | ||
assert_privileges('resource_pool_infra_view') | ||
super | ||
end | ||
|
||
def index | ||
redirect_to(:action => 'show_list') | ||
end | ||
|
||
def show_list | ||
assert_privileges('resource_pool_infra_show_list') | ||
super | ||
end | ||
|
||
def show | ||
assert_privileges('resource_pool_infra_show') | ||
super | ||
end | ||
|
||
private | ||
|
||
def record_class | ||
%w[all_vms vms].include?(params[:display]) ? VmOrTemplate : ResourcePool | ||
end | ||
|
||
def textual_group_list | ||
[%i[properties relationships], %i[configuration smart_management]] | ||
end | ||
|
||
helper_method :textual_group_list | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _("Compute")}, | ||
{:title => _("Infrastructure")}, | ||
{:title => _("Resource Pools"), :url => controller_url}, | ||
], | ||
{:title => _("Resource Pools"), :url => controller_url} | ||
] | ||
} | ||
end | ||
|
||
menu_section :inf | ||
menu_section :resource_pool_infra | ||
feature_for_actions "#{controller_name}_show_list", *ADV_SEARCH_ACTIONS | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module ResourcePoolCloudHelper | ||
include_concern 'TextualSummary' | ||
include ResourcePoolConfigHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
app/helpers/resource_pool_helper.rb → app/helpers/resource_pool_config_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module ResourcePoolInfraHelper | ||
include_concern 'TextualSummary' | ||
include ResourcePoolConfigHelper | ||
end |
Oops, something went wrong.