cloudStack 3.0 new UI - domain page - add VM limits, IP limits, Volume limits, Snapshot limits, Template limits field.

This commit is contained in:
Jessica Wang 2011-11-08 12:14:45 -08:00
parent 9e070e41b9
commit b8ba041027
1 changed files with 52 additions and 1 deletions

View File

@ -140,6 +140,26 @@
},
{
id: { label: 'ID' },
vmLimit: {
label: 'Instance limits',
isEditable: true
},
ipLimit: {
label: 'Public IP limits',
isEditable: true
},
volumeLimit: {
label: 'Volume limits',
isEditable: true
},
snapshotLimit: {
label: 'Snapshot limits',
isEditable: true
},
templateLimit: {
label: 'Template limits',
isEditable: true
},
accountTotal: { label: 'Accounts' },
vmTotal: { label: 'Instances' },
volumeTotal: { label: 'Volumes' }
@ -191,7 +211,38 @@
domainObj["volumeTotal"] = total;
}
});
$.ajax({
url: createURL("listResourceLimits&domainid=" + domainObj.id),
async: false,
dataType: "json",
success: function(json) {
var limits = json.listresourcelimitsresponse.resourcelimit;
if (limits != null) {
for (var i = 0; i < limits.length; i++) {
var limit = limits[i];
switch (limit.resourcetype) {
case "0":
domainObj["vmLimit"] = limit.max;
break;
case "1":
domainObj["ipLimit"] = limit.max;
break;
case "2":
domainObj["volumeLimit"] = limit.max;
break;
case "3":
domainObj["snapshotLimit"] = limit.max;
break;
case "4":
domainObj["templateLimit"] = limit.max;
break;
}
}
}
}
});
args.response.success({
data: domainObj
});