cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/object_store to 47aeda9
Date Thu, 16 May 2013 20:13:56 GMT
Updated Branches:
  refs/heads/object_store d5ab59614 -> 47aeda989


CLOUDSTACK-2505: object_store - UI - infrastructure menu - add secondary storage- Swift -
not pass details[i] info when corresponding field is empty.


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

Branch: refs/heads/object_store
Commit: 47aeda9893ff218fe6f52467d3eb762d9417f445
Parents: d5ab596
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu May 16 13:13:29 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu May 16 13:13:29 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47aeda98/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 4c95b0b..5cb59a3 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -11196,8 +11196,7 @@
                     'details[2].value': args.data.bucket,
                     'details[3].key': 'usehttps',
                     'details[3].value': (args.data.usehttps != null && args.data.usehttps
== 'on' ? 'true' : 'false')
-                  };
-                  debugger; 
+                  };                  
                   var index = 4;
                   if(args.data.endpoint != null && args.data.endpoint.length >
0){
                     data['details[' + index.toString() + '].key'] = 'endpoint';
@@ -11260,18 +11259,29 @@
                   }   
                 }
                 else if(args.data.provider == 'Swift') {
+                  var data = {
+                    provider: args.data.provider,
+                    url: args.data.url
+                  };                 
+                  var index = 0;
+                  if(args.data.account != null && args.data.account.length > 0){
+                    data['details[' + index.toString() + '].key'] = 'account';
+                    data['details[' + index.toString() + '].value'] = args.data.account;
                   
+                    index++;
+                  }
+                  if(args.data.username != null && args.data.username.length >
0){
+                    data['details[' + index.toString() + '].key'] = 'username';
+                    data['details[' + index.toString() + '].value'] = args.data.username;
                   
+                    index++;
+                  }
+                  if(args.data.key != null && args.data.key.length > 0){
+                    data['details[' + index.toString() + '].key'] = 'key';
+                    data['details[' + index.toString() + '].value'] = args.data.key;    
               
+                    index++;
+                  }                 
                   $.ajax({
                     url: createURL('addImageStore'),
-                    data: {
-                      provider: args.data.provider,
-                      url: args.data.url,
-                      'details[0].key': 'account',
-                      'details[0].value': args.data.account,
-                      'details[1].key': 'username',
-                      'details[1].value': args.data.username,
-                      'details[2].key': 'key',
-                      'details[2].value': args.data.key                      
-                    },
+                    data: data,
                     success: function(json) {
                       havingSwift = true;
                       var item = json.addimagestoreresponse.secondarystorage;


Mime
View raw message