cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From du...@apache.org
Subject [35/50] [abbrv] git commit: updated refs/heads/ldapplugin to bdba0dd
Date Fri, 30 Aug 2013 23:28:28 GMT
CLOUDSTACK-4266: UI > Infrastructure > clusters > add cluster dialog > if configuration
'vmware.use.dvswitch' is set to false (i.e. override public/guest traffic checkboxes are hidden),
hide VSM fields (regardless of another configuration 'vmware.use.nexus.switch').


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

Branch: refs/heads/ldapplugin
Commit: 0f4917154ea07db434ce110287c8adc2d7e4a50d
Parents: 2a0e371
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Aug 29 14:13:00 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu Aug 29 14:19:28 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 141 ++++++++++++++++++++++++----------------------
 1 file changed, 74 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0f491715/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 8eb113e..43f7b2a 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10285,9 +10285,8 @@
                             createForm: {
                                 title: 'label.add.cluster',
                                 preFilter: function(args) {
-                                    var $form = args.$form;
-                                    
-                                    $form.click(function() { 
+                                    var $form = args.$form;                             
      
+                                    $form.click(function() {  
                                         var $vsmFields = $form.find('.form-item').filter(function()
{
                                             var vsmFields = [
                                                 'vsmipaddress',
@@ -10297,21 +10296,26 @@
                                             return $.inArray($(this).attr('rel'), vsmFields)
> -1;
                                         });
                                         var $vsmReqFields = $form.find('.form-item').filter(function()
{
-                                            var vsmFields = [
+                                            var vsmReqFields = [
                                                 'vsmipaddress_req',
                                                 'vsmusername_req',
                                                 'vsmpassword_req'
                                             ];	
-                                            return $.inArray($(this).attr('rel'), vsmFields)
> -1;
-                                        });                                    	
+                                            return $.inArray($(this).attr('rel'), vsmReqFields)
> -1;
+                                        });                                           
                                     	
                                     	if ($form.find('.form-item[rel=hypervisor] select').val()
== 'VMware' ) {   
                                     		$form.find('.form-item[rel=vCenterHost]').css('display',
'inline-block');
                                             $form.find('.form-item[rel=vCenterUsername]').css('display',
'inline-block');
                                             $form.find('.form-item[rel=vCenterPassword]').css('display',
'inline-block');
                                             $form.find('.form-item[rel=vCenterDatacenter]').css('display',
'inline-block');
-                                             
-                                            //***** 'vmware.use.dvswitch' (begin) (whether
to show override traffic checkbox) *****
+                                            
+                                            var $overridePublicTraffic = $form.find('.form-item[rel=overridepublictraffic]
input[type=checkbox]');
+	                                        var $vSwitchPublicType = $form.find('.form-item[rel=vSwitchPublicType]
select');	                                        
+	                                        var $overrideGuestTraffic = $form.find('.form-item[rel=overrideguesttraffic]
input[type=checkbox]');
+	                                        var $vSwitchGuestType = $form.find('.form-item[rel=vSwitchGuestType]
select');    	                                        
+		                                            
+                                            //***** 'vmware.use.dvswitch' : whether to show
override traffic checkbox (begin) *****
                                             var dvSwitchEnabled = false;
                                             $.ajax({
                                                 url: createURL('listConfigurations'),
@@ -10325,57 +10329,53 @@
                                                     }
                                                 }
                                             });                                    		   
                                        
-                                            if (dvSwitchEnabled) {                      
                                 
+                                            if (dvSwitchEnabled == true) {              
                                         
                                                 $form.find('.form-item[rel=overridepublictraffic]').css('display',
'inline-block');                                               
-                                                $form.find('.form-item[rel=overrideguesttraffic]').css('display',
'inline-block');                                             
-                                            } else {                                    
                   
+                                                $form.find('.form-item[rel=overrideguesttraffic]').css('display',
'inline-block');   
+                                                
+                                                //'vmware.use.nexus.vswitch': whether to
show VSM fields (begin)
+                                        		var vSwitchEnabled = false;                   
                        
+                                                $.ajax({
+                                                    url: createURL('listConfigurations'),
+                                                    data: {
+                                                        name: 'vmware.use.nexus.vswitch'
+                                                    },
+                                                    async: false,
+                                                    success: function(json) {
+                                                        if (json.listconfigurationsresponse.configuration[0].value
== 'true') {
+                                                            vSwitchEnabled = true;
+                                                        }
+                                                    }
+                                                });
+                                                if (vSwitchEnabled == true) {    
+        	                                        if (($overridePublicTraffic.is(':checked')
&& $vSwitchPublicType.val() == 'nexusdvs') ||
+        	                                            ($overrideGuestTraffic.is(':checked')
&& $vSwitchGuestType.val() == 'nexusdvs' )) {
+        	                                            $vsmReqFields.css('display', 'inline-block');
+        	                                            $vsmFields.hide();
+        	                                        } else {
+        	                                            $vsmFields.css('display', 'inline-block');
+        	                                            $vsmReqFields.hide();
+        	                                        }
+                                                	
+                                                } else { //vSwitchEnabled == false      
                                                                                         
                                                                             	
+                                                	$vsmFields.hide();
+                                                	$vsmReqFields.hide();
+                                                }  
+                                                //***** 'vmware.use.dvswitch' : whether to
show override traffic checkbox (end) *****
+                                                
+                                            } else { //dvSwitchEnabled == false         
                                            
                                                 $form.find('.form-item[rel=overridepublictraffic]').css('display',
'none');
                                                 $form.find('.form-item[rel=vSwitchPublicType]').css('display',
'none');
                                                 $form.find('.form-item[rel=vSwitchPublicName]').css('display',
'none');
                                                 
                                                 $form.find('.form-item[rel=overrideguesttraffic]').css('display',
'none');
                                                 $form.find('.form-item[rel=vSwitchGuestType]').css('display',
'none');                                                
-                                                $form.find('.form-item[rel=vSwitchGuestName]').css('display',
'none');        
-                                            }
-                                            //***** 'vmware.use.dvswitch' (end) *****   
-                                            
-                                            //***** 'vmware.use.nexus.vswitch' (begin) (whether
to show VSM fields) *****
-                                    		var vSwitchEnabled = false;                       
                    
-                                            $.ajax({
-                                                url: createURL('listConfigurations'),
-                                                data: {
-                                                    name: 'vmware.use.nexus.vswitch'
-                                                },
-                                                async: false,
-                                                success: function(json) {
-                                                    if (json.listconfigurationsresponse.configuration[0].value
== 'true') {
-                                                        vSwitchEnabled = true;
-                                                    }
-                                                }
-                                            });
-                                            if (vSwitchEnabled) {
-                                                //$vsmFields.css('display', 'inline-block');
                                           	 
-    	                                        var $overridePublicTraffic = $form.find('.form-item[rel=overridepublictraffic]
input[type=checkbox]');
-    	                                        var $vSwitchPublicType = $form.find('.form-item[rel=vSwitchPublicType]
select');
-    	                                        
-    	                                        var $overrideGuestTraffic = $form.find('.form-item[rel=overrideguesttraffic]
input[type=checkbox]');
-    	                                        var $vSwitchGuestType = $form.find('.form-item[rel=vSwitchGuestType]
select');    	                                        
-    		
-    	                                        if (($overridePublicTraffic.is(':checked') &&
$vSwitchPublicType.val() == 'nexusdvs') ||
-    	                                            ($overrideGuestTraffic.is(':checked') &&
$vSwitchGuestType.val() == 'nexusdvs' )) {
-    	                                            $vsmReqFields.css('display', 'inline-block');
-    	                                            $vsmFields.hide();
-    	                                        } else {
-    	                                            $vsmFields.css('display', 'inline-block');
-    	                                            $vsmReqFields.hide();
-    	                                        }
-                                            	
-                                            } else {
-                                                //$vsmFields.css('display', 'none');    
                                                                                         
                                	
-                                            	$vsmFields.hide();
+                                                $form.find('.form-item[rel=vSwitchGuestName]').css('display',
'none');    
+                                                
+                                                $vsmFields.hide();
                                             	$vsmReqFields.hide();
-                                            }  
-                                          //***** 'vmware.use.nexus.vswitch' (end) *****
+                                            }
+                                            //***** 'vmware.use.dvswitch' (end) *****   
                                           
 	                                        
                                         } else { //XenServer, KVM, etc (non-VMware)
                                             $form.find('.form-item[rel=vCenterHost]').css('display',
'none');
@@ -10385,14 +10385,26 @@
                                             $form.find('.form-item[rel=enableNexusVswitch]').css('display',
'none');
                                             
                                             $form.find('.form-item[rel=overridepublictraffic]').css('display',
'none');
-                                            $form.find('.form-item[rel=overrideguesttraffic]').css('display',
'none');
-                                            $form.find('.form-item[rel=vSwitchPublicType]').css('display',
'none');
-                                            $form.find('.form-item[rel=vSwitchGuestType]').css('display',
'none');
-                                            $form.find('.form-item[rel=vSwitchPublicName]').css('display',
'none');
-                                            $form.find('.form-item[rel=vSwitchGuestName]').css('display',
'none');                                                                                 
  	
+                                            $form.find('.form-item[rel=overrideguesttraffic]').css('display',
'none');                                                                                 
                                      	
                                         	$vsmFields.hide();
                                         	$vsmReqFields.hide();
-                                        }                                    	
+                                        }  
+                                    	                                       
+                                        if ($form.find('.form-item[rel=overridepublictraffic]').css('display')
!= 'none' && $overridePublicTraffic.is(':checked')) {
+                                        	$form.find('.form-item[rel=vSwitchPublicType]').css('display',
'inline-block');   
+                                            $form.find('.form-item[rel=vSwitchPublicName]').css('display',
'inline-block');   
+                                        } else {
+                                        	$form.find('.form-item[rel=vSwitchPublicType]').css('display',
'none'); 
+                                            $form.find('.form-item[rel=vSwitchPublicName]').css('display',
'none');
+                                        }
+                                        
+                                        if ($form.find('.form-item[rel=overrideguesttraffic]').css('display')
!= 'none' && $overrideGuestTraffic.is(':checked')) {
+                                        	$form.find('.form-item[rel=vSwitchGuestType]').css('display',
'inline-block');   
+                                            $form.find('.form-item[rel=vSwitchGuestName]').css('display',
'inline-block');   
+                                        } else {
+                                        	$form.find('.form-item[rel=vSwitchGuestType]').css('display',
'none'); 
+                                            $form.find('.form-item[rel=vSwitchGuestName]').css('display',
'none');
+                                        }                                        
                                     });
                                     
                                     $form.trigger('click');
@@ -10630,14 +10642,12 @@
                                             args.response.success({
                                                 data: items
                                             });
-                                        },
-                                        isHidden: true,
-                                        dependsOn: 'overridepublictraffic'
+                                        },                                        
+                                        isHidden: true                                  
     
                                     },
 
                                     vSwitchPublicName: {
-                                        label: 'Public Traffic vSwitch Name',
-                                        dependsOn: 'overridepublictraffic',
+                                        label: 'Public Traffic vSwitch Name',           
                            
                                         isHidden: true
                                     },
 
@@ -10649,7 +10659,6 @@
                                         docID: 'helpOverrideGuestNetwork'
                                     },
 
-
                                     vSwitchGuestType: {
                                         label: 'Guest Traffic vSwitch Type',
                                         select: function(args) {
@@ -10703,13 +10712,11 @@
                                                 data: items
                                             });
                                         },
-                                        isHidden: true,
-                                        dependsOn: 'overrideguesttraffic'
+                                        isHidden: true
                                     },
 
                                     vSwitchGuestName: {
-                                        label: ' Guest Traffic vSwitch Name',
-                                        dependsOn: 'overrideguesttraffic',
+                                        label: ' Guest Traffic vSwitch Name',           
                           
                                         isHidden: true
                                     },
 


Mime
View raw message