Skip to content

Commit

Permalink
Merge pull request #1224 from MaysaMacedo/display_assets_detail
Browse files Browse the repository at this point in the history
Display assets detail
  • Loading branch information
martinpovolny committed May 16, 2017
2 parents 5892895 + 777cc6d commit b49a4a3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/physical_server_controller.rb
Expand Up @@ -34,7 +34,7 @@ def show_list

def textual_group_list
[
%i(properties networks relationships power_management),
%i(properties networks relationships power_management assets),
]
end
helper_method :textual_group_list
Expand Down
31 changes: 31 additions & 0 deletions app/helpers/physical_server_helper/textual_summary.rb
Expand Up @@ -27,6 +27,13 @@ def textual_group_networks
TextualGroup.new(_("Networks"), %i(mac ipv4 ipv6))
end

def textual_group_assets
TextualGroup.new(
_("Assets"),
%i(support_contact description location room_id rack_name lowest_rack_unit)
)
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 @@ -90,4 +97,28 @@ def textual_ipv6
def textual_loc_led_state
{:label => _("Identify LED State"), :value => @record.location_led_state}
end

def textual_support_contact
{:label => _("Support contact"), :value => @record.asset_details['contact']}
end

def textual_description
{:label => _("Description"), :value => @record.asset_details['description']}
end

def textual_location
{:label => _("Location"), :value => @record.asset_details['location']}
end

def textual_room_id
{:label => _("Room"), :value => @record.asset_details['room_id']}
end

def textual_rack_name
{:label => _("Rack name"), :value => @record.asset_details['rack_name']}
end

def textual_lowest_rack_unit
{:label => _("Lowest rack name"), :value => @record.asset_details['lowest_rack_unit']}
end
end

0 comments on commit b49a4a3

Please sign in to comment.