diff --git a/app/controllers/infra_networking_controller.rb b/app/controllers/infra_networking_controller.rb index 849f0ed309ff..5b2f75203cbc 100644 --- a/app/controllers/infra_networking_controller.rb +++ b/app/controllers/infra_networking_controller.rb @@ -6,7 +6,7 @@ class InfraNetworkingController < ApplicationController after_action :set_session_data include Mixins::GenericSessionMixin - include Mixins::ExplorerPresenterMixin + # include Mixins::ExplorerPresenterMixin include Mixins::FindRecord include Mixins::CustomButtonDialogFormMixin include Mixins::BreadcrumbsMixin @@ -37,7 +37,11 @@ def tagging_explorer_controller? end def show_searchbar? - true + @record.nil? ? true : false + end + + def display_back_button? + false end def tree_select @@ -87,6 +91,10 @@ def load_or_clear_adv_search def show assert_privileges("infra_networking_view") + @center_toolbar = 'infra_networking' + @lastaction = "show" + @display = 'main' + @showtype = 'main' @switch = @record = identify_record(params[:id], Switch) end @@ -125,6 +133,15 @@ def explorer render :layout => "application" end + def index + @lastaction = "index" + + build_accordions_and_trees + @in_a_form = false + + render :layout => "application" + end + def tagging assert_privileges("infra_networking_tag") tagging_edit('Switch', false) diff --git a/app/helpers/infra_networking_helper/textual_summary.rb b/app/helpers/infra_networking_helper/textual_summary.rb index b73176ced901..b1aa1ccbfbf1 100644 --- a/app/helpers/infra_networking_helper/textual_summary.rb +++ b/app/helpers/infra_networking_helper/textual_summary.rb @@ -8,7 +8,7 @@ def textual_group_properties end def textual_group_relationships - TextualGroup.new(_("Relationships"), %i[hosts custom_button_events]) + TextualGroup.new(_("Relationships"), %i[hosts custom_button_events lans]) end def textual_group_smart_management @@ -28,6 +28,11 @@ def textual_hosts h end + def textual_lans + portgroups = @record.lans.map(&:name) + {:label => _("Portgroup"), :icon => "pficon pficon-network", :value => portgroups.join(', ')} + end + def textual_custom_button_events return nil unless User.current_user.super_admin_user? || User.current_user.admin?