Skip to content

Commit

Permalink
Display nested Resource Pools in summary page
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Zigmund committed Jan 26, 2017
1 parent 2a1907c commit 5617caf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/helpers/resource_pool_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def textual_group_properties
end

def textual_group_relationships
%i(parent_datacenter parent_cluster parent_host direct_vms allvms_size total_vms)
%i(parent_datacenter parent_cluster parent_host direct_vms allvms_size total_vms resource_pools)
end

def textual_group_configuration
Expand Down Expand Up @@ -115,6 +115,16 @@ def textual_total_vms
h
end

def textual_resource_pools
num = @record.number_of(:resource_pools)
h = {:label => _("Resource Pools"), :icon => "pficon pficon-resource-pool", :value => num}
if num > 0 && role_allows?(:feature => "resource_pool_show_list")
h[:title] = _("Show all Resource Pools")
h[:link] = url_for(:controller => "resource_pool", :action => 'show', :id => @record, :display => 'resource_pools')
end
h
end

def textual_memory_reserve
value = @record.memory_reserve
return nil if value.nil?
Expand Down
7 changes: 7 additions & 0 deletions app/views/layouts/listnav/_resource_pool.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@
:display => "descendant_vms",
:record_id => @record.id,
:title => _('Show tree of all VMs in this Resource Pool'))

- if role_allows?(:feature => "resource_pool_show_list")
= li_link(:count => @record.all_resource_pools.size,
:text => _("Resource Pools"),
:display => "resource_pools",
:record_id => @record.id,
:title => _('Show all Resource Pools in this Resource Pool'))

0 comments on commit 5617caf

Please sign in to comment.