bug 14368: cloudstack 3.0 UI - domain page - add "Update Resource Count" action ("Update Resource Count" is different from "Update Resource Limit")

This commit is contained in:
Jessica Wang 2012-04-13 10:17:03 -07:00
parent 03c75a05dc
commit 6ccfd8ed4f
1 changed files with 31 additions and 3 deletions

View File

@ -192,7 +192,35 @@
}
}
}
}
},
updateResourceCount: {
label: 'label.action.update.resource.count',
messages: {
confirm: function(args) {
return 'message.update.resource.count';
},
notification: function(args) {
return 'label.action.update.resource.count';
}
},
action: function(args) {
$.ajax({
url: createURL("updateResourceCount&domainid=" + args.context.domains[0].id),
dataType: "json",
async: true,
success: function(json) {
//var resourcecounts= json.updateresourcecountresponse.resourcecount; //do nothing
args.response.success();
}
});
},
notification: {
poll: function(args) {
args.complete();
}
}
}
},
tabs: {
details: {
@ -362,11 +390,11 @@
if(isAdmin()) {
allowedActions.push("create");
if(jsonObj.level != 0) { //ROOT domain (whose level is 0) is not allowed to edit or delete
allowedActions.push("edit"); //merge updateResourceCount into edit
allowedActions.push("edit"); //merge updateResourceLimit into edit
allowedActions.push("delete");
}
}
//allowedActions.push("updateResourceCount");
allowedActions.push("updateResourceCount");
return allowedActions;
}