Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display "FloatingIp belongs to NetworkRouter" relation #4331

Merged
merged 1 commit into from Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"