You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2012/08/02 23:23:36 UTC

git commit: CS-15798: Support editing of VPC resource limits

Updated Branches:
  refs/heads/vpc 2cb141e6a -> c12734eab


CS-15798: Support editing of VPC resource limits


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/c12734ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/c12734ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/c12734ea

Branch: refs/heads/vpc
Commit: c12734eab63edb8639fdc5116aa8f8b54c3bede5
Parents: 2cb141e
Author: Brian Federle <br...@citrix.com>
Authored: Thu Aug 2 14:22:20 2012 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Thu Aug 2 14:22:45 2012 -0700

----------------------------------------------------------------------
 ui/scripts/accounts.js |   46 +++++++++++++++++++++++++++++--------------
 ui/scripts/domains.js  |   45 ++++++++++++++++++++++++++++--------------
 2 files changed, 61 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c12734ea/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 6692f85..9762313 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -330,6 +330,15 @@
                       accountObj["templateLimit"] = args.data.templateLimit;
                     }
                   });
+                  
+                  $.ajax({
+                    url: createURL("updateResourceLimit&resourceType=7&max=" + todb(args.data.vpcLimit) + "&account=" + accountObj.name + "&domainid=" + accountObj.domainid),
+                    dataType: "json",
+                    async: false,
+                    success: function(json) {
+                      accountObj["vpcLimit"] = args.data.vpcLimit;
+                    }
+                  });
 
                   if(errorMsg == "")
                   args.response.success({data: accountObj});
@@ -559,6 +568,10 @@
                       label: 'label.template.limits',
                       isEditable: true
                     },
+                    vpcLimit: {
+                      label: 'VPC limits',
+                      isEditable: true
+                    },
 
                     vmtotal: { label: 'label.total.of.vm' },
                     iptotal: { label: 'label.total.of.ip' },
@@ -599,21 +612,24 @@
 														for (var i = 0; i < limits.length; i++) {
 															var limit = limits[i];
 															switch (limit.resourcetype) {
-																case "0":
-																	accountObj["vmLimit"] = limit.max;
-																	break;
-																case "1":
-																	accountObj["ipLimit"] = limit.max;
-																	break;
-																case "2":
-																	accountObj["volumeLimit"] = limit.max;
-																	break;
-																case "3":
-																	accountObj["snapshotLimit"] = limit.max;
-																	break;
-																case "4":
-																	accountObj["templateLimit"] = limit.max;
-																	break;
+															case "0":
+																accountObj["vmLimit"] = limit.max;
+																break;
+															case "1":
+																accountObj["ipLimit"] = limit.max;
+																break;
+															case "2":
+																accountObj["volumeLimit"] = limit.max;
+																break;
+															case "3":
+																accountObj["snapshotLimit"] = limit.max;
+																break;
+															case "4":
+																accountObj["templateLimit"] = limit.max;
+																break;
+                              case "7":
+																accountObj["vpcLimit"] = limit.max;
+																break;
 															}
 														}
 													}																										

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c12734ea/ui/scripts/domains.js
----------------------------------------------------------------------
diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js
index 439f73a..3383c57 100644
--- a/ui/scripts/domains.js
+++ b/ui/scripts/domains.js
@@ -149,6 +149,14 @@
                   domainObj["templateLimit"] = args.data.templateLimit;
                 }
               });
+              $.ajax({
+                url: createURL("updateResourceLimit&domainid=" + args.context.domains[0].id + "&resourceType=7&max=" + args.data.vpcLimit),
+                dataType: "json",
+                async: false,
+                success: function(json) {
+                  domainObj["vpcLimit"] = args.data.vpcLimit;
+                }
+              });
 
               args.response.success({data: domainObj});
             }
@@ -266,6 +274,10 @@
                   label: 'label.template.limits',
                   isEditable: true
                 },
+                vpcLimit: {
+                  label: 'VPC limits',
+                  isEditable: true
+                },
                 accountTotal: { label: 'label.accounts' },
                 vmTotal: { label: 'label.instances' },
                 volumeTotal: { label: 'label.volumes' }
@@ -328,21 +340,24 @@
                     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;
+                      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;
+                      case "7":
+                        domainObj["vpcLimit"] = limit.max;
+                        break;
                       }
                     }
                   }