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 eeb0123
Date Mon, 13 May 2013 22:11:23 GMT
Updated Branches:
  refs/heads/object_store 1694c1a50 -> eeb012308


CLOUDSTACK-2351: object store - UI - zone wizard - add secondary storage step - when provider
is S3, add Create NFS Cache Storage option.


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

Branch: refs/heads/object_store
Commit: eeb012308cd5e85b6a0f4130c55735756bf266c2
Parents: 1694c1a
Author: Jessica Wang <jessicawang@apache.org>
Authored: Fri May 10 11:03:54 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon May 13 15:10:34 2013 -0700

----------------------------------------------------------------------
 ui/scripts/zoneWizard.js |   62 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 58 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eeb01230/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index bcad6e8..75a2962 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -810,7 +810,7 @@
                 if($(this).val() == "VMware") {
                   //$('li[input_sub_group="external"]', $dialogAddCluster).show();
                   if(dvSwitchEnabled ){
-                     /*   $form.find('.form-item[rel=vSwitchPublicType]').css('display',
'inline-block');
+                     /*   $fields.filter('[rel=vSwitchPublicType]').css('display', 'inline-block');
                         $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block');
                        
                         $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block');
@@ -1563,7 +1563,11 @@
                       $fields.filter('[rel=connectiontimeout]').hide();
                       $fields.filter('[rel=maxerrorretry]').hide();
                       $fields.filter('[rel=sockettimeout]').hide();
-
+                      
+                      $fields.filter('[rel=createNfsCache]').hide();
+                      $fields.filter('[rel=nfsCacheNfsServer]').hide();
+                      $fields.filter('[rel=nfsCachePath]').hide();
+                      
                       //Swift
                       $fields.filter('[rel=url]').hide();
                       $fields.filter('[rel=account]').hide();
@@ -1586,6 +1590,11 @@
                       $fields.filter('[rel=maxerrorretry]').css('display', 'inline-block');
                       $fields.filter('[rel=sockettimeout]').css('display', 'inline-block');
 
+                      $fields.filter('[rel=createNfsCache]').find('input').attr('checked','checked');
+                      $fields.filter('[rel=createNfsCache]').css('display', 'inline-block');
 
+                      $fields.filter('[rel=nfsCacheNfsServer]').css('display', 'inline-block');
+                      $fields.filter('[rel=nfsCachePath]').css('display', 'inline-block');
+                      
                       //Swift
                       $fields.filter('[rel=url]').hide();
                       $fields.filter('[rel=account]').hide();
@@ -1608,6 +1617,10 @@
                       $fields.filter('[rel=maxerrorretry]').hide();
                       $fields.filter('[rel=sockettimeout]').hide();
 
+                      $fields.filter('[rel=createNfsCache]').hide();
+                      $fields.filter('[rel=nfsCacheNfsServer]').hide();
+                      $fields.filter('[rel=nfsCachePath]').hide();
+                      
                       //Swift
                       $fields.filter('[rel=url]').css('display', 'inline-block');
                       $fields.filter('[rel=account]').css('display', 'inline-block');
@@ -1650,6 +1663,22 @@
           connectiontimeout: { label: 'label.s3.connection_timeout' },
           maxerrorretry: { label: 'label.s3.max_error_retry' },
           sockettimeout: { label: 'label.s3.socket_timeout' },
+          
+          createNfsCache: {
+            label: 'Create NFS Cache Storage',
+            isBoolean: true,                    
+            isChecked: true                    
+          },     
+          nfsCacheNfsServer: {
+            dependsOn: 'createNfsCache',
+            label: 'label.nfs.server',                    
+            validation: { required: true }
+          },
+          nfsCachePath: {
+            dependsOn: 'createNfsCache',
+            label: 'label.path',                    
+            validation: { required: true }
+          },                  
           //S3 (end)
           
           
@@ -3587,11 +3616,36 @@
                   })
                 });
               },
-              error: function(json) {
+              error: function(XMLHttpResponse) {
                 var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                 error('addSecondaryStorage', errorMsg, { fn: 'addSecondaryStorage', args:
args });
               }
             });
+                        
+            if(args.data.secondaryStorage.createNfsCache == 'on') {
+              var zoneid = args.data.secondaryStorage.nfsCacheZoneid;
+              var nfs_server = args.data.secondaryStorage.nfsCacheNfsServer;
+              var path = args.data.secondaryStorage.nfsCachePath;
+              var url = nfsURL(nfs_server, path);
+              
+              var nfsCacheData = {
+                provider: 'NFS',
+                zoneid: args.data.returnedZone.id,
+                url: url                    
+              };        
+              
+              $.ajax({
+                url: createURL('createCacheStore'),
+                data: nfsCacheData,
+                success: function(json) {
+                  //do nothing                        
+                },
+                error: function(XMLHttpResponse) {
+                  var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+                  error('addSecondaryStorage', errorMsg, { fn: 'addSecondaryStorage', args:
args });
+                }
+              }); 
+            }     
           }
           else if(args.data.secondaryStorage.provider == 'Swift') {
             $.ajax({
@@ -3613,7 +3667,7 @@
                   })
                 });
               },
-              error: function(json) {
+              error: function(XMLHttpResponse) {
                 var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                 error('addSecondaryStorage', errorMsg, { fn: 'addSecondaryStorage', args:
args });
               }


Mime
View raw message