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 assets detail #1224

Merged
merged 3 commits into from May 16, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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