incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject [38/50] [abbrv] git commit: refs/heads/affinity_groups - User accounts UI: Support for regions
Date Thu, 14 Mar 2013 22:35:17 GMT
User accounts UI: Support for regions

-Add region select to add account form

-Show account's region in detail view


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

Branch: refs/heads/affinity_groups
Commit: 98c4e8f36715779f563a46b278ca8eda59aa4824
Parents: 456fefe
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Feb 27 08:59:55 2013 -0800
Committer: Prachi Damle <prachi@cloud.com>
Committed: Thu Mar 14 15:13:32 2013 -0700

----------------------------------------------------------------------
 ui/scripts/accounts.js |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/98c4e8f3/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 4c327ee..3727f8e 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -113,6 +113,31 @@
                     validation: { required: true },
                     docID: 'helpAccountLastName'
                   },
+                  regionid: {
+                    label: 'label.region',
+                    select: function(args) {
+                      $.ajax({
+                        url: createURL('listRegions&listAll=true'),
+                        success: function(json) {
+                          var regions = json.listregionsresponse.region;
+                          var regionOptions;
+
+                          if (!regions) {
+                            regionOptions = [{ id: 0, description: '0 - Default' }];
+                          } else {
+                            regionOptions = $(regions).map(function(index, region) {
+                              return {
+                                id: region.id,
+                                description: region.id + ' - ' + region.name
+                              };
+                            });
+                          }
+
+                          args.response.success({ data: regionOptions });
+                        }
+                      });
+                    }
+                  },
                   domainid: {
                     label: 'label.domain',
                     docID: 'helpAccountDomain',
@@ -181,7 +206,7 @@
 
               action: function(args) {
                 var data = {
-								  username: args.data.username									
+								  username: args.data.username,
 								};															               
                
                 var password = args.data.password;
@@ -196,6 +221,7 @@
 								  email: args.data.email,
                   firstname: args.data.firstname,
                   lastname: args.data.lastname,
+                  regionid: args.data.regionid,
                   domainid: args.data.domainid									
 								});								              
 
@@ -290,7 +316,8 @@
 									  domainid: accountObj.domainid,
 										account: accountObj.name,
 										newname: args.data.name,
-										networkdomain: args.data.networkdomain
+										networkdomain: args.data.networkdomain,
+                    regionid: accountObj.regionid ? accountObj.regionid : 0
 									};
                 
                   $.ajax({
@@ -634,6 +661,7 @@
                         return cloudStack.converters.toRole(args);
                       }
                     },
+                    regionid: { label: 'label.region' },
                     domain: { label: 'label.domain' },
                     state: { label: 'label.state' },
                     networkdomain: {


Mime
View raw message