Skip to content

Commit

Permalink
Add physical server relationship
Browse files Browse the repository at this point in the history
 - Adds physical server to host summary page in relationships label
  • Loading branch information
gabrielsvinha committed Jun 5, 2017
1 parent 59e9e86 commit 3bbf51e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/helpers/host_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def textual_group_properties
def textual_group_relationships
TextualGroup.new(
_("Relationships"),
%i(ems cluster availability_zone used_tenants storages resource_pools vms templates drift_history)
%i(ems cluster availability_zone used_tenants storages resource_pools vms templates drift_history physical_server)
)
end

Expand Down Expand Up @@ -235,6 +235,14 @@ def textual_cluster
h
end

def textual_physical_server
if @record.physical_server_id.nil?
{:label => _("Physical Server"), :value => _("None"), :icon => "pficon pficon-server"}
else
{:label => _("Physical Server"), :value => @record.physical_server.try(:name), :icon => "pficon pficon-server", :link => url_for(:controller => 'physical_server', :action => 'show', :id => @record.physical_server_id)}
end
end

def textual_storages
return nil if @record.openstack_host?
textual_link(@record.storages)
Expand Down
9 changes: 9 additions & 0 deletions app/views/layouts/listnav/_host.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@
:record_id => @record.id,
:title => _("Show %{host} drift history") % {:host => host_title})

- if role_allows?(:feature => "physical_server_show") && [email protected]_server.nil?
%li
= link_to("#{ui_lookup(:table => "physical_server")}: #{@record.physical_server.name}",
{:controller => "physical_server", :action => 'show', :id => @record.physical_server.id},
:title => _("Show Physical Server"))

- if role_allows?(:feature => "physical_server_show") && @record.physical_server.nil?
= li_link(:if => false, :text => "#{ui_lookup(:table => "physical_server")}: #{_('None')}")

= miq_accordion_panel(_("Security"), false, "host_sec") do
%ul.nav.nav-pills.nav-stacked
= li_link(:count => @record.number_of(:users),
Expand Down

0 comments on commit 3bbf51e

Please sign in to comment.