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
5d9bb09
commit f212495
Showing
34 changed files
with
1,186 additions
and
38 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 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,96 @@ | ||
class ResourcePoolCloudController < 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' | ||
delete_resource_pools | ||
replace_gtl_main_div if @refresh_div == 'main_div' && @lastaction == 'show_list' | ||
when 'resource_pool_protect' | ||
assign_policies(ResourcePool) | ||
else | ||
super | ||
end | ||
|
||
render_flash unless performed? | ||
end | ||
|
||
def self.model | ||
ManageIQ::Providers::CloudManager::ResourcePool | ||
end | ||
|
||
def download_data | ||
assert_privileges('resource_pool_cloud_view') | ||
super | ||
end | ||
|
||
def download_summary_pdf | ||
assert_privileges('resource_pool_cloud_view') | ||
super | ||
end | ||
|
||
def breadcrumb_name(_model) | ||
_("Cloud Resource Pools") | ||
end | ||
|
||
def self.table_name | ||
@table_name ||= "resource_pool" | ||
end | ||
|
||
def index | ||
redirect_to(:action => 'show_list') | ||
end | ||
|
||
def show_list | ||
assert_privileges('resource_pool_cloud_show_list') | ||
super | ||
end | ||
|
||
def show | ||
assert_privileges('resource_pool_cloud_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 => _("Clouds")}, | ||
{:title => _("Resource Pools"), :url => controller_url}, | ||
], | ||
} | ||
end | ||
|
||
menu_section :resource_pool_cloud | ||
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
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 |
Oops, something went wrong.