Skip to content

Commit

Permalink
Display "FloatingIp belongs to NetworkRouter" relation
Browse files Browse the repository at this point in the history
With this commit we enhance UI with relation between NetworkRouter
and FloatingIp (and vice versa).

Signed-off-by: Miha Pleško <miha.plesko@xlab.si>
  • Loading branch information
miha-plesko committed Jul 23, 2018
1 parent 9599f05 commit 8c545fa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/network_router_controller.rb
Expand Up @@ -11,7 +11,7 @@ class NetworkRouterController < ApplicationController
include Mixins::GenericFormMixin

def self.display_methods
%w(instances cloud_subnets)
%w(instances cloud_subnets floating_ips)
end

def button
Expand Down
6 changes: 5 additions & 1 deletion app/helpers/floating_ip_helper/textual_summary.rb
Expand Up @@ -10,7 +10,7 @@ def textual_group_properties
end

def textual_group_relationships
TextualGroup.new(_("Relationships"), %i(parent_ems_cloud ems_network cloud_tenant instance network_port))
TextualGroup.new(_("Relationships"), %i(parent_ems_cloud ems_network cloud_tenant instance network_port network_router))
end

#
Expand Down Expand Up @@ -57,4 +57,8 @@ def textual_cloud_tenant
def textual_network_port
@record.network_port
end

def textual_network_router
textual_link(@record.network_router, :label => _('Network Router'))
end
end
6 changes: 5 additions & 1 deletion app/helpers/network_router_helper/textual_summary.rb
Expand Up @@ -13,7 +13,7 @@ def textual_group_properties
def textual_group_relationships
TextualGroup.new(
_("Relationships"),
%i(parent_ems_cloud ems_network cloud_tenant instances cloud_subnets external_gateway)
%i(parent_ems_cloud ems_network cloud_tenant instances cloud_subnets external_gateway floating_ips)
)
end

Expand Down Expand Up @@ -86,4 +86,8 @@ def textual_cloud_subnets
def textual_external_gateway
textual_link(@record.cloud_network, :label => _('Cloud Network'))
end

def textual_floating_ips
textual_link(@record.floating_ips, :label => _('Floating Ips'))
end
end
2 changes: 1 addition & 1 deletion app/views/network_router/show.html.haml
@@ -1,5 +1,5 @@
#main_div
- if %w(instances cloud_subnets).include?(@display) && @showtype != "compare"
- if %w(instances cloud_subnets floating_ips).include?(@display) && @showtype != "compare"
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"}
- elsif @showtype == 'main'
= render :partial => "layouts/textual_groups_generic"

0 comments on commit 8c545fa

Please sign in to comment.