CLOUDSTACK-2120: mixed zone management - UI: count total number of Primary Storages, Secondary Storages based on selected option in zone type dropdown on top menu.

This commit is contained in:
Jessica Wang 2013-04-25 14:24:44 -07:00
parent 880f98c023
commit f883b0f904
1 changed files with 23 additions and 12 deletions

View File

@ -269,29 +269,40 @@
},
primaryStorageCount: function(data) {
var data2 = {
page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
};
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
$.ajax({
url: createURL('listStoragePools'),
data: {
page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
},
data: data2,
success: function(json) {
dataFns.secondaryStorageCount($.extend(data, {
primaryStorageCount: json.liststoragepoolsresponse.count ?
json.liststoragepoolsresponse.count : 0
dataFns.secondaryStorageCount($.extend(data, {
primaryStorageCount: json.liststoragepoolsresponse.count ? json.liststoragepoolsresponse.count : 0
}));
}
});
},
secondaryStorageCount: function(data) {
var data2 = {
type: 'SecondaryStorage',
page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
};
if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type
$.extend(data2, {
zonetype: cloudStack.context.zoneType
});
}
$.ajax({
url: createURL('listHosts'),
data: {
type: 'SecondaryStorage',
page: 1,
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
},
data: data2,
success: function(json) {
dataFns.systemVmCount($.extend(data, {
secondaryStorageCount: json.listhostsresponse.count ?