cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject [3/4] git commit: updated refs/heads/4.2-forward to 5b93398
Date Tue, 27 Aug 2013 00:04:05 GMT
CLOUDSTACK-4508: UI > Infrastructure > clusters > add cluster dialog > VSM fields
> pass only value of visible VSM fields to API call.


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

Branch: refs/heads/4.2-forward
Commit: 9fc905383d132d0bb3abfd22109123df7d4355ec
Parents: 202e57a
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Aug 26 16:35:04 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Aug 26 16:35:04 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 70 +++++++++++++++--------------------------------
 1 file changed, 22 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9fc90538/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 07b0bb8..2d8bc05 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10429,31 +10429,16 @@
                                                     return $.inArray($(this).attr('rel'),
vsmFields) > -1;
                                                 });
 
-                                                if ($(this).val() == "VMware") {
-                                                    //$('li[input_sub_group="external"]',
$dialogAddCluster).show();
-
-                                                    if (dvSwitchEnabled) {
-                                                        // $form.find('.form-item[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');
-                                                        //$form.find('.form-item[rel=vSwitchGuestName]').css('display','inline-block');
+                                                if ($(this).val() == "VMware") {      
+                                                    if (dvSwitchEnabled) {              
                                         
                                                         $form.find('.form-item[rel=overridepublictraffic]').css('display',
'inline-block');
                                                         $form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').removeAttr('checked');
 
                                                         $form.find('.form-item[rel=overrideguesttraffic]').css('display',
'inline-block');
                                                         $form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').removeAttr('checked');
-
-
-
-                                                    } else {
-                                                        //  $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');
+                                                    } else {                            
                           
                                                         $form.find('.form-item[rel=overridepublictraffic]').css('display',
'none');
                                                         $form.find('.form-item[rel=overrideguesttraffic]').css('display',
'none');
-
-
                                                     }
                                                     $form.find('.form-item[rel=vCenterHost]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=vCenterUsername]').css('display',
'inline-block');
@@ -10465,9 +10450,8 @@
                                                     } else {
                                                         $vsmFields.css('display', 'none');
                                                     }
+                                                    
                                                 } else {
-
-
                                                     $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');
@@ -10475,7 +10459,6 @@
                                                     $form.find('.form-item[rel=vSwitchPublicName]').css('display',
'none');
                                                     $form.find('.form-item[rel=vSwitchGuestName]').css('display',
'none');
 
-
                                                     $form.find('.form-item[rel=vCenterHost]').css('display',
'none');
                                                     $form.find('.form-item[rel=vCenterUsername]').css('display',
'none');
                                                     $form.find('.form-item[rel=vCenterPassword]').css('display',
'none');
@@ -10561,8 +10544,6 @@
                                                         data: items
                                                     });
                                                 }
-
-
                                             });
                                         }
                                     },
@@ -10575,11 +10556,9 @@
                                         validation: {
                                             required: false
                                         }
-
                                     },
 
                                     //hypervisor==VMWare begins here
-
                                     vCenterHost: {
                                         label: 'label.vcenter.host',
                                         docID: 'helpClustervCenterHost',
@@ -10610,7 +10589,6 @@
                                         isHidden: true,
                                         isChecked: false,
                                         docID: 'helpOverridePublicNetwork'
-
                                     },
 
 
@@ -10633,7 +10611,6 @@
                                             });
 
                                             if (vSwitchEnabled) {
-
                                                 items.push({
                                                     id: "nexusdvs",
                                                     description: "Cisco Nexus 1000v Distributed
Virtual Switch"
@@ -10646,13 +10623,7 @@
                                                     id: "vmwaredvs",
                                                     description: "VMware vNetwork Distributed
Virtual Switch"
                                                 });
-
-
-
-
                                             }
-
-                                            // items.push({id: "" , description:" " });
                                             else {
                                                 items.push({
                                                     id: "vmwaredvs",
@@ -10680,8 +10651,6 @@
                                         label: 'Public Traffic vSwitch Name',
                                         dependsOn: 'overridepublictraffic',
                                         isHidden: true
-
-
                                     },
 
                                     overrideguesttraffic: {
@@ -10690,7 +10659,6 @@
                                         isHidden: true,
                                         isChecked: false,
                                         docID: 'helpOverrideGuestNetwork'
-
                                     },
 
 
@@ -10698,8 +10666,7 @@
                                         label: 'Guest Traffic vSwitch Type',
                                         select: function(args) {
                                             var items = []
-                                            //  items.push({id: "" , description:" " });
-
+                                            
                                             var vSwitchEnabled = false;
                                             $.ajax({
                                                 url: createURL('listConfigurations'),
@@ -10742,24 +10709,20 @@
                                                     id: "nexusdvs",
                                                     description: "Cisco Nexus 1000v Distributed
Virtual Switch"
                                                 });
-
-
                                             }
+                                            
                                             args.response.success({
                                                 data: items
                                             });
                                         },
                                         isHidden: true,
                                         dependsOn: 'overrideguesttraffic'
-
                                     },
 
                                     vSwitchGuestName: {
                                         label: ' Guest Traffic vSwitch Name',
                                         dependsOn: 'overrideguesttraffic',
                                         isHidden: true
-
-
                                     },
 
 
@@ -10846,18 +10809,29 @@
                                     if (args.data.vSwitchGuestName != "")
                                         array1.push("&guestvswitchname=" + args.data.vSwitchGuestName);
 
-                                    if (args.data.vsmipaddress != null && args.data.vsmipaddress.length
> 0) {
+                                    //Nexus VSM fields                                 
+                                    if (args.$form.find('.form-item[rel=vsmipaddress]').css('display')
!= 'none' && args.data.vsmipaddress != null && args.data.vsmipaddress.length
> 0) {
                                         array1.push('&vsmipaddress=' + args.data.vsmipaddress);
                                       
                                     }
+                                    if (args.$form.find('.form-item[rel=vsmipaddress_req]').css('display')
!= 'none' && args.data.vsmipaddress_req != null && args.data.vsmipaddress_req.length
> 0) {
+                                        array1.push('&vsmipaddress=' + args.data.vsmipaddress_req);
                                       
+                                    }
                                     
-                                    if(args.data.vsmusername != null && args.data.vsmusername.length
> 0) {
+                                    if(args.$form.find('.form-item[rel=vsmusername]').css('display')
!= 'none' && args.data.vsmusername != null && args.data.vsmusername.length
> 0) {
                                     	array1.push('&vsmusername=' + args.data.vsmusername);
                                     }
+                                    if(args.$form.find('.form-item[rel=vsmusername_req]').css('display')
!= 'none' && args.data.vsmusername_req != null && args.data.vsmusername_req.length
> 0) {
+                                    	array1.push('&vsmusername=' + args.data.vsmusername_req);
+                                    }
                                     
-                                    if(args.data.vsmpassword != null && args.data.vsmpassword.length
> 0) {
+                                    if(args.$form.find('.form-item[rel=vsmpassword]').css('display')
!= 'none' && args.data.vsmpassword != null && args.data.vsmpassword.length
> 0) {
                                     	array1.push('&vsmpassword=' + args.data.vsmpassword);
-                                    }                                                   
                    
-
+                                    }   
+                                    if(args.$form.find('.form-item[rel=vsmpassword_req]').css('display')
!= 'none' && args.data.vsmpassword_req != null && args.data.vsmpassword_req.length
> 0) {
+                                    	array1.push('&vsmpassword=' + args.data.vsmpassword_req);
+                                    } 
+                                    
+                                    
                                     var hostname = args.data.vCenterHost;
                                     var dcName = args.data.vCenterDatacenter;
 


Mime
View raw message