From 6ccfd8ed4f59c9cc909587361da849f2c813c76e Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 13 Apr 2012 10:17:03 -0700 Subject: [PATCH] bug 14368: cloudstack 3.0 UI - domain page - add "Update Resource Count" action ("Update Resource Count" is different from "Update Resource Limit") --- ui/scripts/domains.js | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js index 5e6ddb78ef2..a751baf2fdf 100644 --- a/ui/scripts/domains.js +++ b/ui/scripts/domains.js @@ -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; }