mirror of https://github.com/apache/cloudstack.git
cloudstack UI - Infrastructure page - (1) restore hosts count on UI since listHosts API has been fixed. (2) specifying pagesize as 1 because we don't need any embedded objects to be returned for count display.
This commit is contained in:
parent
c2ccc52c4d
commit
becd611c07
|
|
@ -194,6 +194,10 @@
|
|||
podCount: function(data) {
|
||||
$.ajax({
|
||||
url: createURL('listPods'),
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
dataFns.clusterCount($.extend(data, {
|
||||
podCount: json.listpodsresponse.count ?
|
||||
|
|
@ -206,20 +210,24 @@
|
|||
clusterCount: function(data) {
|
||||
$.ajax({
|
||||
url: createURL('listClusters'),
|
||||
success: function(json) {
|
||||
/*
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
dataFns.hostCount($.extend(data, {
|
||||
clusterCount: json.listclustersresponse.count ?
|
||||
json.listclustersresponse.count : 0
|
||||
}));
|
||||
*/
|
||||
|
||||
//comment the 4 lines above and uncomment the following 4 lines if listHosts API still responds slowly.
|
||||
|
||||
//uncomment the 4 lines above and remove the following 4 lines after "count" in listHosts API is fixed.
|
||||
/*
|
||||
dataFns.primaryStorageCount($.extend(data, {
|
||||
clusterCount: json.listclustersresponse.count ?
|
||||
json.listclustersresponse.count : 0
|
||||
}));
|
||||
|
||||
*/
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -228,7 +236,9 @@
|
|||
$.ajax({
|
||||
url: createURL('listHosts'),
|
||||
data: {
|
||||
type: 'routing'
|
||||
type: 'routing',
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
dataFns.primaryStorageCount($.extend(data, {
|
||||
|
|
@ -242,20 +252,24 @@
|
|||
primaryStorageCount: function(data) {
|
||||
$.ajax({
|
||||
url: createURL('listStoragePools'),
|
||||
success: function(json) {
|
||||
/*
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
dataFns.secondaryStorageCount($.extend(data, {
|
||||
primaryStorageCount: json.liststoragepoolsresponse.count ?
|
||||
json.liststoragepoolsresponse.count : 0
|
||||
}));
|
||||
*/
|
||||
|
||||
//comment the 4 lines above and uncomment the following 4 lines if listHosts API still responds slowly.
|
||||
|
||||
//uncomment the 4 lines above and remove the following 4 lines after "count" in listHosts API is fixed.
|
||||
/*
|
||||
dataFns.systemVmCount($.extend(data, {
|
||||
primaryStorageCount: json.liststoragepoolsresponse.count ?
|
||||
json.liststoragepoolsresponse.count : 0
|
||||
}));
|
||||
|
||||
*/
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -264,7 +278,9 @@
|
|||
$.ajax({
|
||||
url: createURL('listHosts'),
|
||||
data: {
|
||||
type: 'SecondaryStorage'
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
dataFns.systemVmCount($.extend(data, {
|
||||
|
|
@ -278,6 +294,10 @@
|
|||
systemVmCount: function(data) {
|
||||
$.ajax({
|
||||
url: createURL('listSystemVms'),
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
dataFns.virtualRouterCount($.extend(data, {
|
||||
systemVmCount: json.listsystemvmsresponse.count ?
|
||||
|
|
@ -291,14 +311,18 @@
|
|||
$.ajax({
|
||||
url: createURL('listRouters'),
|
||||
data: {
|
||||
projectid: -1
|
||||
projectid: -1,
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
var total1 = json.listroutersresponse.count ? json.listroutersresponse.count : 0;
|
||||
$.ajax({
|
||||
url: createURL('listRouters'),
|
||||
data: {
|
||||
listAll: true
|
||||
listAll: true,
|
||||
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.
|
||||
},
|
||||
success: function(json) {
|
||||
var total2 = json.listroutersresponse.count ? json.listroutersresponse.count : 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue