Skip to content

Commit

Permalink
Add support fo prometheus endpoint in container provider summary page
Browse files Browse the repository at this point in the history
refactoring

refactoring

some refactoring
  • Loading branch information
nimrodshn committed Jun 13, 2017
1 parent c321505 commit 1a69170
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions app/helpers/ems_container_helper/textual_summary.rb
Expand Up @@ -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
Expand Down

0 comments on commit 1a69170

Please sign in to comment.