Updated Branches:
  refs/heads/master 361ca9643 -> 3ee3e4122

cloudstack 3.0 UI - add zone wizard - (1) When sdn.ovs.controller is true and 
when the physical network is in Advanced zone, show isolation method dropdown 
with two options (VLAN, GRE). VLAN is the default option in the dropdown.

(2) When sdn.ovs.controller is false: hide isolation method dropdown. 
isolationmethods parameter won’t be passed to createPhysicalNetwork API.
(3) When the physical network is in Basic zone (regardless of 
sdn.ovs.controller) : hide isolation method dropdown. isolationmethods 
parameter won’t be passed to createPhysicalNetwork API.


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

Branch: refs/heads/master
Commit: 3ee3e4122ab52c16ea57973265bdf1b61689bf8f
Parents: 361ca96
Author: Jessica Wang <[email protected]>
Authored: Fri Jun 22 16:06:51 2012 -0700
Committer: Jessica Wang <[email protected]>
Committed: Fri Jun 22 16:07:12 2012 -0700

----------------------------------------------------------------------
 ui/scripts/ui-custom/zoneWizard.js |   79 +++++++++++++++++++-----------
 1 files changed, 50 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3ee3e412/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js 
b/ui/scripts/ui-custom/zoneWizard.js
index 8f1a872..d46bad9 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -568,37 +568,58 @@
                                $('<div>').addClass('value').append(
                                        $('<input>').attr({ type: 'text' 
}).addClass('required')
         )                              
-      );                       
-                       if($wizard.find('.select-network-model 
input:radio[name=network-model]:checked').val() == 'Advanced') {
-                               $nameField.append(
-                                       $('<div>').addClass('name').append(
-                                               $('<label>').html('Physical 
network name')
-                                       ),
-                                       $('<div>').addClass('value').append(
-                                               $('<input>').attr({ type: 
'text' }).addClass('required')
-                                       ),
-                                       $('<div>').append(
-                                               $('<span 
style=\"font-size:11px\;padding-right:5px;padding-left:50px">').html('Isolation 
method'),
-                                               $('<select>').append(           
                                
-                                                       $('<option>').attr({
-                                                               value: ''
-                                                       }).html(''),            
                        
-                                                       $('<option>').attr({
-                                                               value: 'VLAN'
-                                                       }).html('VLAN'),        
                                        
-                                                       //User should not be 
given the option to create a physical network with "L3" isolation method. 
(CS-15312)
-                                                       /*
-                                                       $('<option>').attr({
-                                                               value: 'L3'
-                                                       }).html('L3'),          
-                                                       */                      
                        
-                                                       $('<option>').attr({
-                                                               value: 'GRE'
-                                                       }).html('GRE')  
+      );       
+
+      
+                       var ovsTunnelManager = false;
+                       $.ajax({
+                               url: createURL('listConfigurations'),
+                               data: {
+                                       name: 'sdn.ovs.controller'
+                               },
+                               dataType: "json",
+                               async: false,
+                               success: function(json) {                       
                 
+                                       var items = 
json.listconfigurationsresponse.configuration; //2 entries returned: 
'sdn.ovs.controller', 'sdn.ovs.controller.default.label'
+                                       $(items).each(function(){               
                                  
+                                               if(this.name == 
'sdn.ovs.controller') {
+                                                       if(this.value == 'true' 
|| this.value == true) {
+                                                               
ovsTunnelManager = true;
+                                                       }
+                                                       return false; //break 
each loop
+                                               }
+                                       });                                     
        
+                               }
+                       });     
+      //when OVS tunnel manager is used                        
+      if(ovsTunnelManager == true) {   
+                         //Advanced zone supports 2 isolation method(VLAN, 
GRE), so show dropdown including the 2 options
+                               if($wizard.find('.select-network-model 
input:radio[name=network-model]:checked').val() == 'Advanced') { 
+                                       $nameField.append(
+                                               
$('<div>').addClass('name').append(
+                                                       
$('<label>').html('Physical network name')
+                                               ),
+                                               
$('<div>').addClass('value').append(
+                                                       $('<input>').attr({ 
type: 'text' }).addClass('required')
+                                               ),
+                                               $('<div>').append(
+                                                       $('<span 
style=\"font-size:11px\;padding-right:5px;padding-left:50px">').html('Isolation 
method'),
+                                                       $('<select>').append(   
        
+                                                               
$('<option>').attr({
+                                                                       value: 
'VLAN'
+                                                               
}).html('VLAN'),        
+                                                               
$('<option>').attr({
+                                                                       value: 
'GRE'
+                                                               }).html('GRE')  
+                                                       )
                                                )
-                                       )
-                               );
+                                       );
+                               }
+                               //Basic zone supports only 1 isolation method 
(L3), so there is no point showing dropdown.
                        }
+                       //when OVS tunnel manager is not used, isolationmethods 
parameter in createPhysicalNetwork API is ignored. So no showing dropdown.      
+      //isolationmethods parameter has not been used by network gurus so far. 
By default(i.e. when OVS tunnel manager is not used), networks are isolated 
with VLANs in Advanced zone, with L3 in basic zone.
+                                               
                        
       var $dropContainer = $('<div>').addClass('drop-container').append(
         $('<span>').addClass('empty-message').html(

Reply via email to