Skip to content

Commit

Permalink
Merge pull request ManageIQ#1276 from CharlleDaniel/add_network_data_…
Browse files Browse the repository at this point in the history
…in_server_detail_table

Add network data in physical server details table
  • Loading branch information
martinpovolny authored May 12, 2017
2 parents 66d9fb6 + a288315 commit 77900cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/physical_server_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def show_list

def textual_group_list
[
%i(properties relationships power_management),
%i(properties networks relationships power_management),
]
end
helper_method :textual_group_list
Expand Down
16 changes: 16 additions & 0 deletions app/helpers/physical_server_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def textual_group_power_management
def textual_group_compliance
end

def textual_group_networks
TextualGroup.new(_("Networks"), %i(mac ipv4 ipv6))
end

def textual_host
{:label => _("Host"), :value => @record.host.try(:name), :icon => "pficon pficon-virtual-machine", :link => url_for(:controller => 'host', :action => 'show', :id => @record.host.try(:id))}
end
Expand Down Expand Up @@ -70,4 +74,16 @@ def textual_cores
def textual_power_state
{:label => _("Power State"), :value => @record.power_state}
end

def textual_mac
{:label => _("Mac Address"), :value => @record.hardware.guest_devices.collect { |device| device[:address] }.join(", ") }
end

def textual_ipv4
{:label => _("IPV4 Address"), :value => @record.hardware.guest_devices.collect { |device| device.network.ipaddress }.join(", ") }
end

def textual_ipv6
{:label => _("IPV6 Address"), :value => @record.hardware.guest_devices.collect { |device| device.network.ipv6address }.join(", ") }
end
end

0 comments on commit 77900cd

Please sign in to comment.