-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6782 from h-kataria/configuration_manager_non_exp…
…lorer_version Configuration manager non explorer version
- Loading branch information
Showing
85 changed files
with
1,314 additions
and
2,671 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
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,52 @@ | ||
class ConfigurationProfileController < ApplicationController | ||
include Mixins::GenericListMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::BreadcrumbsMixin | ||
|
||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def self.display_methods | ||
%w[configured_systems] | ||
end | ||
|
||
def button | ||
@edit = session[:edit] # Restore @edit for adv search box | ||
params[:display] = @display if display_methods.include?(@display) # Were we displaying nested list | ||
|
||
# Handle Toolbar Policy Tag Button | ||
@refresh_div = "main_div" # Default div for button.rjs to refresh | ||
|
||
if params[:pressed].starts_with?("configured_system_") # Handle buttons from sub-items screen | ||
tag(ConfiguredSystem) if params[:pressed] == "configured_system_tag" | ||
provision if params[:pressed] == "configured_system_provision" | ||
end | ||
|
||
if @refresh_div == "main_div" && @lastaction == "show_list" | ||
replace_gtl_main_div | ||
else | ||
render_flash unless performed? | ||
end | ||
end | ||
|
||
def show_list | ||
opts = {:no_checkboxes => true} | ||
process_show_list(opts) | ||
end | ||
|
||
private | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _("Configuration Profile")}, | ||
{:title => _("Profiles"), :url => controller_url}, | ||
], | ||
} | ||
end | ||
|
||
menu_section :conf | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
class ConfiguredSystemController < ApplicationController | ||
include Mixins::GenericListMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::BreadcrumbsMixin | ||
include Mixins::ManagerControllerMixin | ||
|
||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def self.table_name | ||
@table_name ||= "configured_system" | ||
end | ||
|
||
def button | ||
@edit = session[:edit] # Restore @edit for adv search box | ||
|
||
# Handle Toolbar Policy Tag Button | ||
@refresh_div = "main_div" # Default div for button.rjs to refresh | ||
model = self.class.model | ||
tag(model) if params[:pressed] == "configured_system_tag" | ||
provision if params[:pressed] == "configured_system_provision" | ||
render_flash unless performed? | ||
end | ||
|
||
def show_list | ||
options = {:named_scope => :under_configuration_managers} | ||
process_show_list(options) | ||
end | ||
|
||
private | ||
|
||
def textual_group_list | ||
[%i[properties relationships environment], %i[os tenancy tags]] | ||
end | ||
helper_method :textual_group_list | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _("Configuration Management")}, | ||
{:title => _("Configured Systems"), :url => controller_url}, | ||
], | ||
} | ||
end | ||
|
||
menu_section :conf | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
class EmsConfigurationController < ApplicationController | ||
include Mixins::GenericListMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::BreadcrumbsMixin | ||
include Mixins::GenericFormMixin | ||
include Mixins::ManagerControllerMixin | ||
include Mixins::FindRecord | ||
|
||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def self.model | ||
ManageIQ::Providers::ConfigurationManager | ||
end | ||
|
||
def self.table_name | ||
@table_name ||= "ems_configuration" | ||
end | ||
|
||
def self.display_methods | ||
%w[configuration_profiles configured_systems] | ||
end | ||
|
||
def button | ||
@edit = session[:edit] # Restore @edit for adv search box | ||
params[:display] = @display if display_methods.include?(@display) # Were we displaying nested list | ||
|
||
# Handle Toolbar Policy Tag Button | ||
@refresh_div = "main_div" # Default div for button.rjs to refresh | ||
model = self.class.model | ||
tag(model) if params[:pressed] == "#{params[:controller]}_tag" | ||
return if ["#{params[:controller]}_tag"].include?(params[:pressed]) && @flash_array.nil? # Tag screen showing | ||
|
||
if params[:pressed].starts_with?("configured_system_") # Handle buttons from sub-items screen | ||
tag(ConfiguredSystem) if params[:pressed] == "configured_system_tag" | ||
provision if params[:pressed] == "configured_system_provision" | ||
end | ||
|
||
case params[:pressed] | ||
when 'ems_configuration_edit_provider' | ||
edit | ||
when 'ems_configuration_add_provider' | ||
new | ||
when "ems_configuration_refresh_provider" | ||
refresh | ||
when "ems_configuration_delete_provider" | ||
delete | ||
end | ||
|
||
if single_delete_test | ||
single_delete_redirect | ||
elsif (params[:pressed].ends_with?("_edit_provider") || params[:pressed] == "ems_configuration_add_provider") && @flash_array.nil? | ||
if @flash_array | ||
show_list | ||
replace_gtl_main_div | ||
else | ||
javascript_redirect(:action => @refresh_partial, :id => @redirect_id) | ||
end | ||
elsif @refresh_div == "main_div" && @lastaction == "show_list" | ||
replace_gtl_main_div | ||
else | ||
render_flash unless performed? | ||
end | ||
end | ||
|
||
private | ||
|
||
def self.model_to_name(_provmodel) | ||
Dictionary.gettext('ems_configuration', :type => :ui_title, :translate => false) | ||
end | ||
|
||
def manager_prefix | ||
"configuration_manager" | ||
end | ||
|
||
def privilege_prefix | ||
"ems_configuration" | ||
end | ||
|
||
def refresh | ||
assert_privileges("ems_configuration_refresh_provider") | ||
manager_button_operation('refresh_ems', _('Refresh')) | ||
end | ||
|
||
def concrete_model | ||
ManageIQ::Providers::ConfigurationManager | ||
end | ||
|
||
def provider_class | ||
ManageIQ::Providers::Foreman::Provider | ||
end | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _("Configuration Management")}, | ||
{:title => _("Providers"), :url => controller_url}, | ||
], | ||
} | ||
end | ||
|
||
def set_redirect_vars | ||
@in_a_form = true | ||
@redirect_controller = "ems_configuration" | ||
@redirect_id = @provider_manager.id if @provider_manager.try(:id) | ||
@refresh_partial = @provider_manager.try(:id) ? "edit" : "new" | ||
end | ||
|
||
menu_section :conf | ||
end |
Oops, something went wrong.