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/master to 24d6055
Date Mon, 03 Jun 2013 18:26:57 GMT
Updated Branches:
  refs/heads/master db655ae8c -> 24d605517


CLOUDSTACK-2744: UI - create network offering dialog - when LB Type is selected as PublicLb,
hide internalLbVm from provider list.


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

Branch: refs/heads/master
Commit: 24d6055177e8430993eae81b217991e2a09ec0ca
Parents: db655ae
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Jun 3 11:25:42 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Jun 3 11:25:42 2013 -0700

----------------------------------------------------------------------
 ui/scripts/configuration.js |  100 ++++++++++++++++++--------------------
 1 files changed, 48 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24d60551/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 8a4aa7d..44f4095 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -1215,12 +1215,57 @@
                       $availability.hide();
                     }
 
+                    
+                    //*** LB providers ***
+                    var $lbProvider = args.$form.find('.form-item[rel=\"service.Lb.provider\"]').find('select');
+                    var $lbProviderOptions = $lbProvider.find('option');
 										//when useVpc is checked and service.Lb.isEnabled is checked                  
 
                     if($useVpcCb.is(':checked') && $("input[name='service.Lb.isEnabled']").is(":checked")
== true) {  
-                      $lbType.css('display', 'inline-block');    
+                      $lbType.css('display', 'inline-block');   
+                                                                                        
                
+                      if($lbType.find('select').val() == 'publicLb') { //disable all providers
except the ones in lbProviderMap.publicLb.vpc => ["VpcVirtualRouter", "Netscaler"] 
+                        for(var i = 0; i < $lbProviderOptions.length; i++ ) {
+                          var $option = $lbProviderOptions.eq(i);                       
   
+                          var supportedProviders = lbProviderMap.publicLb.vpc;          
                 
+                          var thisOpionIsSupported = false;
+                          for(var k = 0; k < supportedProviders.length; k++ ) {
+                            if($option.val() == supportedProviders[k]) {
+                              thisOpionIsSupported = true;
+                              break;
+                            }                               
+                          }   
+                          if(thisOpionIsSupported == true) {
+                            $option.attr('disabled', false);
+                          }
+                          else {
+                            $option.attr('disabled', true);
+                          }                            
+                        }                                                    
+                      }                          
+                      else if($lbType.find('select').val() == 'internalLb') { //disable all
providers except the ones in lbProviderMap.internalLb.vpc => ["InternalLbVm"]
+                        for(var i = 0; i < $lbProviderOptions.length; i++ ) {
+                          var $option = $lbProviderOptions.eq(i);                       
   
+                          var supportedProviders = lbProviderMap.internalLb.vpc;        
                   
+                          var thisOpionIsSupported = false;                            
+                          for(var k = 0; k < supportedProviders.length; k++ ) {
+                            if($option.val() == supportedProviders[k]) {
+                              thisOpionIsSupported = true;
+                              break;
+                            }                               
+                          }  
+                          if(thisOpionIsSupported == true) {
+                            $option.attr('disabled', false);
+                          }
+                          else {
+                            $option.attr('disabled', true);
+                          }                            
+                        }                             
+                      }     
+                      
+                      $lbProvider.val($lbProvider.find('option:first'));     
                     }
                     else {
-                      $lbType.hide();
+                      $lbType.hide();                      
                     }
                     
 										//when service(s) has Virtual Router as provider.....							
@@ -1521,56 +1566,7 @@
                       args.response.success({data: [
                         {id: 'publicLb', description: 'Public LB'}, 
                         {id: 'internalLb', description: 'Internal LB'}
-                      ]}); 
-                                                       
-                      args.$select.change(function() {  
-                        if($(this).is(':visible') == false) 
-                          return; //if lbType is not visible, do nothing.
-                        
-                        var $lbProvider = $(this).closest('form').find('.form-item[rel=\"service.Lb.provider\"]').find('select');
-                        var $lbProviderOptions = $lbProvider.find('option');
-                                                                        
-                        if($(this).val() == 'publicLb') { //disable all providers except
the ones in lbProviderMap.publicLb.vpc => ["VpcVirtualRouter", "Netscaler"] 
-                          for(var i = 0; i < $lbProviderOptions.length; i++ ) {
-                            var $option = $lbProviderOptions.eq(i);                     
     
-                            var supportedProviders = lbProviderMap.publicLb.vpc;        
                   
-                            var thisOpionIsSupported = false;
-                            for(var k = 0; k < supportedProviders.length; k++ ) {
-                              if($option.val() == supportedProviders[k]) {
-                                thisOpionIsSupported = true;
-                                break;
-                              }                               
-                            }   
-                            if(thisOpionIsSupported == true) {
-                              $option.attr('disabled', false);
-                            }
-                            else {
-                              $option.attr('disabled', true);
-                            }                            
-                          }                                                    
-                        }                          
-                        else if($(this).val() == 'internalLb') { //disable all providers
except the ones in lbProviderMap.internalLb.vpc => ["InternalLbVm"]
-                          for(var i = 0; i < $lbProviderOptions.length; i++ ) {
-                            var $option = $lbProviderOptions.eq(i);                     
     
-                            var supportedProviders = lbProviderMap.internalLb.vpc;      
                     
-                            var thisOpionIsSupported = false;                           

-                            for(var k = 0; k < supportedProviders.length; k++ ) {
-                              if($option.val() == supportedProviders[k]) {
-                                thisOpionIsSupported = true;
-                                break;
-                              }                               
-                            }  
-                            if(thisOpionIsSupported == true) {
-                              $option.attr('disabled', false);
-                            }
-                            else {
-                              $option.attr('disabled', true);
-                            }                            
-                          }                             
-                        }     
-                        
-                        $lbProvider.val($lbProvider.find('option:first'));              
         
-                      });
+                      ]});                       
                     }
                   },
                                     


Mime
View raw message