mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
F #2347: Show the total number of VMs in Group in list
This commit is contained in:
parent
0cd63c2d53
commit
a85f4a6383
@ -10,17 +10,22 @@
|
||||
|
||||
:USER:
|
||||
:desc: Username of the VM Group owner
|
||||
:size: 15
|
||||
:size: 8
|
||||
:left: true
|
||||
|
||||
:GROUP:
|
||||
:desc: Group of the VM Group
|
||||
:size: 15
|
||||
:size: 8
|
||||
:left: true
|
||||
|
||||
:VMS:
|
||||
:desc: Number of VMs in the VM Group
|
||||
:size: 4
|
||||
:lef: true
|
||||
|
||||
:ROLES:
|
||||
:desc: Roles in the VM Group
|
||||
:size: 31
|
||||
:size: 36
|
||||
:left: true
|
||||
|
||||
:default:
|
||||
@ -28,4 +33,5 @@
|
||||
- :USER
|
||||
- :GROUP
|
||||
- :NAME
|
||||
- :VMS
|
||||
- :ROLES
|
||||
|
@ -38,15 +38,28 @@ class OneVMGroupHelper < OpenNebulaHelper::OneHelper
|
||||
end
|
||||
|
||||
column :USER, "Username of the VM Group owner", :left,
|
||||
:size=>15 do |d|
|
||||
:size=>8 do |d|
|
||||
helper.user_name(d, options)
|
||||
end
|
||||
|
||||
column :GROUP, "Group of the VM Group", :left, :size=>15 do |d|
|
||||
column :GROUP, "Group of the VM Group", :left, :size=>8 do |d|
|
||||
helper.group_name(d, options)
|
||||
end
|
||||
|
||||
column :ROLES, "Roles in the VM Group", :left, :size=>31 do |d|
|
||||
column :VMS, "Number of VMs in the VM Group", :left, :size=>4 do |d|
|
||||
roles = d["ROLES"]["ROLE"]
|
||||
vms = 0
|
||||
|
||||
if !roles.nil?
|
||||
roles.each { |r|
|
||||
vms += r["VMS"].split(',').size if !r["VMS"].nil?
|
||||
}
|
||||
end
|
||||
|
||||
vms
|
||||
end
|
||||
|
||||
column :ROLES, "Roles in the VM Group", :left, :size=>36 do |d|
|
||||
roles = d["ROLES"]["ROLE"]
|
||||
roles_names = ""
|
||||
|
||||
@ -58,7 +71,7 @@ class OneVMGroupHelper < OpenNebulaHelper::OneHelper
|
||||
roles_names
|
||||
end
|
||||
|
||||
default :ID, :USER, :GROUP, :NAME, :ROLES
|
||||
default :ID, :USER, :GROUP, :NAME, :VMS, :ROLES
|
||||
end
|
||||
|
||||
table
|
||||
|
Loading…
x
Reference in New Issue
Block a user