From 1a69170c743a7828d26569c606c4f90591f9021e Mon Sep 17 00:00:00 2001 From: nimrodshn Date: Mon, 12 Jun 2017 13:47:50 +0300 Subject: [PATCH] Add support fo prometheus endpoint in container provider summary page refactoring refactoring some refactoring --- .../ems_container_helper/textual_summary.rb | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/app/helpers/ems_container_helper/textual_summary.rb b/app/helpers/ems_container_helper/textual_summary.rb index 9dfea2a923e..145a3490477 100644 --- a/app/helpers/ems_container_helper/textual_summary.rb +++ b/app/helpers/ems_container_helper/textual_summary.rb @@ -103,21 +103,17 @@ def textual_volumes end def textual_group_endpoints - return unless @record.connection_configurations.hawkular + endpoints = @record.endpoints.where.not(:role => 'default') + return if endpoints.nil? - TextualGroup.new( - _("Endpoints"), + endpoint_groups = endpoints.map do |e| [ - { - :label => _('Hawkular Host Name'), - :value => @record.connection_configurations.hawkular.endpoint.hostname - }, - { - :label => _('Hawkular API Port'), - :value => @record.connection_configurations.hawkular.endpoint.port - } + {:label => _("%{role} Host Name") % {:role => e.role.capitalize}, :value => e.hostname}, + {:label => _("%{role} API Port") % {:role => e.role.capitalize}, :value => e.port} ] - ) + end + + TextualGroup.new(_("Endpoints"), endpoint_groups.flatten) end def textual_group_miq_custom_attributes