cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject [4/4] git commit: updated refs/heads/4.2-forward to 5b93398
Date Tue, 27 Aug 2013 00:04:06 GMT
CLOUDSTACK-4508: UI > Infrastructure > clusters > add cluster dialog > hide both
required NexusVSM fields and optional NexusVSM fields when hypervisor is not VMware.


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

Branch: refs/heads/4.2-forward
Commit: 5b93398c120edcb8591117cd460020ad3963971e
Parents: 9fc9053
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Aug 26 17:02:24 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Aug 26 17:02:24 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 60 +++++++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b93398c/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 2d8bc05..63e3163 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10287,25 +10287,13 @@
                                 preFilter: function(args) {
                                     var $form = args.$form;
                                     
-                                    $form.click(function() {
-                                        // VSM fields need to be required if a traffic override
is selected
-                                        //
-                                        // ** This is done by switching out optional fields
for required fields;
-                                        //    need to check for *either* vsm[...]_req or
vsm[...]
-                                        
-                                        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');
-                                        
+                                    $form.click(function() { 
                                         var $vsmFields = $form.find('.form-item').filter(function()
{
                                             var vsmFields = [
                                                 'vsmipaddress',
                                                 'vsmusername',
                                                 'vsmpassword'
-                                            ];
-
+                                            ];	
                                             return $.inArray($(this).attr('rel'), vsmFields)
> -1;
                                         });
                                         var $vsmReqFields = $form.find('.form-item').filter(function()
{
@@ -10313,21 +10301,33 @@
                                                 'vsmipaddress_req',
                                                 'vsmusername_req',
                                                 'vsmpassword_req'
-                                            ];
-
+                                            ];	
                                             return $.inArray($(this).attr('rel'), vsmFields)
> -1;
-                                        });
-
-
-                                        if (($overridePublicTraffic.is(':checked') &&
$vSwitchPublicType.val() == 'nexusdvs') ||
-                                            ($overrideGuestTraffic.is(':checked') &&
$vSwitchGuestType.val() == 'nexusdvs' )) {
-                                            $vsmReqFields.css('display', 'inline-block');
-                                            $vsmFields.hide();
+                                        });                                    	
+                                    	
+                                    	if ($form.find('.form-item[rel=hypervisor] select').val()
== 'VMware' ) {   
+	                                        // VSM fields need to be required if a traffic override
is selected and vSwitchType is 'nexusdvs'.                                        
+	                                        // This is done by switching out optional fields
for required fields;     
+	                                        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', 'inline-block');
-                                            $vsmReqFields.hide();
+                                        	$vsmFields.hide();
+                                        	$vsmReqFields.hide();
                                         }
-
+                                    	
                                     });
                                 },
                                 fields: {
@@ -10419,15 +10419,17 @@
 
                                             args.$select.bind("change", function(event) {
                                                 var $form = $(this).closest('form');
+                                                
+                                                /*
                                                 var $vsmFields = $form.find('.form-item').filter(function()
{
                                                     var vsmFields = [
                                                         'vsmipaddress',
                                                         'vsmusername',
                                                         'vsmpassword'
                                                     ];
-
                                                     return $.inArray($(this).attr('rel'),
vsmFields) > -1;
                                                 });
+                                                */
 
                                                 if ($(this).val() == "VMware") {      
                                                     if (dvSwitchEnabled) {              
                                         
@@ -10445,11 +10447,13 @@
                                                     $form.find('.form-item[rel=vCenterPassword]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=vCenterDatacenter]').css('display',
'inline-block');
 
+                                                    /*
                                                     if (vSwitchEnabled) {
                                                         $vsmFields.css('display', 'inline-block');
                                                     } else {
                                                         $vsmFields.css('display', 'none');
                                                     }
+                                                    */
                                                     
                                                 } else {
                                                     $form.find('.form-item[rel=overridepublictraffic]').css('display',
'none');
@@ -10464,7 +10468,7 @@
                                                     $form.find('.form-item[rel=vCenterPassword]').css('display',
'none');
                                                     $form.find('.form-item[rel=vCenterDatacenter]').css('display',
'none');
                                                     $form.find('.form-item[rel=enableNexusVswitch]').css('display',
'none');
-                                                    $vsmFields.css('display', 'none');
+                                                    //$vsmFields.css('display', 'none');
                                                 }
                                             });
                                         }


Mime
View raw message