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

Add Physical Server relationship for Host summary page #1440

Merged
merged 1 commit into from
Jun 6, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 10 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,16 @@
:record_id => @record.id,
:title => _("Show %{host} drift history") % {:host => host_title})

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

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

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