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 2013/02/26 22:28:19 UTC

git commit: refs/heads/ui-regions - Implement 'add region' action

Updated Branches:
  refs/heads/ui-regions 142a5a8fb -> 8831b2920


Implement 'add region' action


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

Branch: refs/heads/ui-regions
Commit: 8831b2920c95616f5024fed16a5dff438e03ae67
Parents: 142a5a8
Author: Brian Federle <br...@citrix.com>
Authored: Tue Feb 26 13:27:59 2013 -0800
Committer: Brian Federle <br...@citrix.com>
Committed: Tue Feb 26 13:27:59 2013 -0800

----------------------------------------------------------------------
 .../WEB-INF/classes/resources/messages.properties  |    2 +
 ui/dictionary.jsp                                  |    2 +
 ui/scripts/regions.js                              |   31 +++++++++++++++
 3 files changed, 35 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8831b292/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index 7374bd8..48e4ecb 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -19,6 +19,8 @@
 #new labels (begin) **********************************************************************************************
 label.menu.regions=Regions
 label.region=Region
+label.add.region=Add Region
+message.add.region=Please specify the required information to add a new region.
 label.endpoint=Endpoint
 label.plugins=Plugins
 label.plugin.details=Plugin details

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8831b292/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 98f6bf8..418b9de 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -25,6 +25,8 @@ under the License.
 <% long now = System.currentTimeMillis(); %>
 <script language="javascript">
 dictionary = {
+'label.add.region': '<fmt:message key="label.add.region"/>',
+'message.add.region': '<fmt:message key="message.add.region"/>',
 'label.region': '<fmt:message key="label.region"/>',
 'label.endpoint': '<fmt:message key="label.endpoint"/>',
 'label.menu.regions': '<fmt:message key="label.menu.regions"/>',

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8831b292/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index f29dc6d..8b0e1af 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -24,6 +24,37 @@
         name: { label: 'label.name' },
         endpoint: { label: 'label.endpoint' }
       },
+      actions: {
+        add: {
+          label: 'label.add.region',
+          messages: {
+            notification: function() { return 'label.add.region'; }
+          },
+          createForm: {
+            title: 'label.add.region',
+            desc: 'message.add.region',
+            fields: {
+              name: { label: 'label.name', validation: { required: true } },
+              endpoint: { label: 'label.endpoint', validation: { url: true, required: true } },
+              userapikey: { label: 'label.api.key' },
+              userapisecretkey: { label: 'label.s3.secret_key' }
+            }
+          },
+          action: function(args) {
+            $.ajax({
+              url: createURL('addRegion'),
+              data: args.data,
+              success: function(json) {
+                var jobID = json.addregionresponse.jobid;
+
+                args.response.success({ _custom: { jobId: jobID }});
+              }
+            });
+            args.response.success();
+          },
+          notification: { poll: pollAsyncJobResult }
+        }
+      },
       dataProvider: function(args) {
         $.ajax({
           url: createURL('listRegions&listAll=true'),