Skip to content

Commit 5767825

Browse files
author
Jessica Wang
committed
CLOUDSTACK-4908: UI > Infrastructure > Sockets > view all > calculate Hosts for each hypervisor.
1 parent c350999 commit 5767825

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

ui/scripts/system.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7125,20 +7125,32 @@
71257125
var listView = {
71267126
id: 'sockets',
71277127
fields: {
7128-
hypervisor: { label: 'label.hypervisor' },
7129-
sockets: { label: 'label.sockets' },
7130-
hosts: { label: 'label.hosts' }
7128+
hypervisor: { label: 'label.hypervisor' },
7129+
hosts: { label: 'label.hosts' },
7130+
sockets: { label: 'label.sockets' }
71317131
},
71327132
dataProvider: function(args) {
71337133
$.ajax({
71347134
url: createURL('listHypervisors'),
71357135
success: function(json) {
71367136
args.response.success({
7137-
data: $(json.listhypervisorsresponse.hypervisor).map(function(index, hypervisor) {
7137+
data: $(json.listhypervisorsresponse.hypervisor).map(function(index, hypervisor) {
7138+
var hostCount;
7139+
$.ajax({
7140+
url: createURL('listHosts'),
7141+
async: false,
7142+
data: {
7143+
hypervisortype: hypervisor.name
7144+
},
7145+
success: function(json) {
7146+
hostCount = json.listhostsresponse.count;
7147+
}
7148+
});
7149+
71387150
return {
71397151
hypervisor: hypervisor.name,
7140-
sockets: 0,
7141-
hosts: 0
7152+
hosts: hostCount,
7153+
sockets: 0
71427154
};
71437155
})
71447156
});

0 commit comments

Comments
 (0)