cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/3] git commit: updated refs/heads/docker to 7c3ab31
Date Wed, 02 Apr 2014 18:50:36 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/docker 2ab75245d -> 7c3ab31fb


update UI in createZone flow


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

Branch: refs/heads/docker
Commit: c13d4770339214e48d6c9bf7c416517b60ef319f
Parents: 2ab7524
Author: tuna <ng.tuna@gmail.com>
Authored: Thu Apr 3 00:03:44 2014 +0700
Committer: tuna <ng.tuna@gmail.com>
Committed: Thu Apr 3 00:03:44 2014 +0700

----------------------------------------------------------------------
 ui/scripts/ui-custom/zoneWizard.js | 191 +++++++++++++++++---------------
 ui/scripts/zoneWizard.js           |  18 ++-
 2 files changed, 115 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c13d4770/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index 7b3a8e1..a9e003e 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -298,89 +298,89 @@
             var fields;
             
             if (hypervisor == 'VMware') {
-            	fields = {
-            		vSwitchName: {
-	                    label: 'vSwitch Name' ,
-	                    defaultValue: trafficData.vSwitchName
-	                },
-	                vlanId: { 
-	                	label: 'VLAN ID',
-	                	defaultValue: trafficData.vlanId
-	                }	                
-	            };  
-            	
-            	if(zoneType == 'Advanced') {
-	            	if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {   
        		
-	            		if(trafficData.vSwitchType == null) {
-	            			 var useDvs = false;
-	                         $.ajax({
-	                             url: createURL('listConfigurations'),
-	                             data: {
-	                                 name: 'vmware.use.dvswitch'
-	                             },
-	                             async: false,
-	                             success: function(json) {
-	                                 if (json.listconfigurationsresponse.configuration[0].value
== 'true') {
-	                                     useDvs = true;
-	                                 }
-	                             }
-	                         });    
-	                         if (useDvs == true) { 
-	                        	 var useNexusDvs = false;                                     
      
-	                             $.ajax({
-	                                 url: createURL('listConfigurations'),
-	                                 data: {
-	                                     name: 'vmware.use.nexus.vswitch'
-	                                 },
-	                                 async: false,
-	                                 success: function(json) {
-	                                     if (json.listconfigurationsresponse.configuration[0].value
== 'true') {
-	                                         useNexusDvs = true;
-	                                     }
-	                                 }
-	                             });
-	                             if (useNexusDvs == true) {
-	                            	 trafficData.vSwitchType = 'nexusdvs';
-	                            	 fields.vSwitchName.defaultValue = 'epp0';
-	                             } else {
-	                            	 trafficData.vSwitchType = 'vmwaredvs';
-	                            	 fields.vSwitchName.defaultValue = 'dvSwitch0';
-	                             }   
-	                         } else { //useDvs == false
-	                        	 trafficData.vSwitchType = 'vmwaresvs';
-	                        	 fields.vSwitchName.defaultValue = 'vSwitch0';
-	                         }                         
-	            		}
-	            		
-	            		$.extend(fields, {
-	            		    vSwitchType: {
-	            		        label: 'vSwitch Type',
-	            		        select: function (args) {            		        	
-	            		            args.response.success({
-	            		                data: [{
-	            		                    id: 'nexusdvs',
-	            		                    description: 'Cisco Nexus 1000v Distributed Virtual Switch'
-	            		                }, {
-	            		                    id: 'vmwaresvs',
-	            		                    description: 'VMware vNetwork Standard Virtual Switch'
-	            		                }, {
-	            		                    id: 'vmwaredvs',
-	            		                    description: 'VMware vNetwork Distributed Virtual Switch'
-	            		                }]
-	            		            });
-	            		        },
-	    		                defaultValue: trafficData.vSwitchType
-	            		    }
-	            		});   
-	            	}  
-            	}
+                fields = {
+                    vSwitchName: {
+                        label: 'vSwitch Name' ,
+                        defaultValue: trafficData.vSwitchName
+                    },
+                    vlanId: { 
+                        label: 'VLAN ID',
+                        defaultValue: trafficData.vlanId
+                    }                   
+                };  
+                
+                if(zoneType == 'Advanced') {
+                    if($trafficType.hasClass('guest') || $trafficType.hasClass('public'))
{                 
+                        if(trafficData.vSwitchType == null) {
+                             var useDvs = false;
+                             $.ajax({
+                                 url: createURL('listConfigurations'),
+                                 data: {
+                                     name: 'vmware.use.dvswitch'
+                                 },
+                                 async: false,
+                                 success: function(json) {
+                                     if (json.listconfigurationsresponse.configuration[0].value
== 'true') {
+                                         useDvs = true;
+                                     }
+                                 }
+                             });    
+                             if (useDvs == true) { 
+                                 var useNexusDvs = false;                               
            
+                                 $.ajax({
+                                     url: createURL('listConfigurations'),
+                                     data: {
+                                         name: 'vmware.use.nexus.vswitch'
+                                     },
+                                     async: false,
+                                     success: function(json) {
+                                         if (json.listconfigurationsresponse.configuration[0].value
== 'true') {
+                                             useNexusDvs = true;
+                                         }
+                                     }
+                                 });
+                                 if (useNexusDvs == true) {
+                                     trafficData.vSwitchType = 'nexusdvs';
+                                     fields.vSwitchName.defaultValue = 'epp0';
+                                 } else {
+                                     trafficData.vSwitchType = 'vmwaredvs';
+                                     fields.vSwitchName.defaultValue = 'dvSwitch0';
+                                 }   
+                             } else { //useDvs == false
+                                 trafficData.vSwitchType = 'vmwaresvs';
+                                 fields.vSwitchName.defaultValue = 'vSwitch0';
+                             }                         
+                        }
+                        
+                        $.extend(fields, {
+                            vSwitchType: {
+                                label: 'vSwitch Type',
+                                select: function (args) {                               
+                                    args.response.success({
+                                        data: [{
+                                            id: 'nexusdvs',
+                                            description: 'Cisco Nexus 1000v Distributed Virtual
Switch'
+                                        }, {
+                                            id: 'vmwaresvs',
+                                            description: 'VMware vNetwork Standard Virtual
Switch'
+                                        }, {
+                                            id: 'vmwaredvs',
+                                            description: 'VMware vNetwork Distributed Virtual
Switch'
+                                        }]
+                                    });
+                                },
+                                defaultValue: trafficData.vSwitchType
+                            }
+                        });   
+                    }  
+                }
             } else {    
-	            fields = {
-	                label: {
-	                    label: hypervisor + ' ' + _l('label.traffic.label'),
-	                    defaultValue: trafficData.label
-	                }
-	            };
+                fields = {
+                    label: {
+                        label: hypervisor + ' ' + _l('label.traffic.label'),
+                        defaultValue: trafficData.label
+                    }
+                };
             }
 
             cloudStack.dialog.createForm({
@@ -1090,7 +1090,17 @@
                 if (typeof index == 'string') {
                     index = $wizard.find('[zone-wizard-step-id=' + index + ']').index() +
1;
                 }
-
+                var formState = getData($wizard, {
+                    all: true
+                });
+                //Docker: hide jump up to step5
+                if(formState != undefined && formState.hypervisor == 'Docker') {
+                    if(index == 11)
+                        index = 13;
+                    if(goBack && index == 12)
+                        index = 10;
+                }
+                //Docker: hide jump up to step5 - end
                 var targetIndex = index - 1;
 
                 if (index <= 1) targetIndex = 0;
@@ -1102,16 +1112,20 @@
                 $wizard.find('.buttons').show();
 
                 var $targetStep = $($steps[targetIndex]).show();
+                
                 var $uiCustom = $targetStep.find('[ui-custom]');
-                var formState = getData($wizard, {
-                    all: true
-                });
+                
                 var groupedFormState = getData($wizard);
                 var formID = $targetStep.attr('zone-wizard-form');
                 var stepPreFilter = cloudStack.zoneWizard.preFilters[
                     $targetStep.attr('zone-wizard-prefilter')
                 ];
-
+                //Docker: hide storage tabs
+                if(index > 8 && formState != undefined && formState.hypervisor
== 'Docker') {
+                    $targetStep.find('.primary-storage').hide();
+                    $targetStep.find('.secondary-storage').hide();
+                }
+                //Docker: hide storage tabs - end
                 // Bypass step check
                 if (stepPreFilter && !stepPreFilter({
                     data: formState,
@@ -1344,8 +1358,7 @@
                             return false;
                         }
                     }
-                    //when hypervisor is BareMetal (end)
-
+                   
                     if (!$target.closest('.button.next.final').size())
                         showStep($steps.filter(':visible').index() + 2);
                     else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c13d4770/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 006bf7d..8397ab3 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -4079,11 +4079,19 @@
                         type: "POST",
                         data: data,
                         success: function(json) {
-                            stepFns.addPrimaryStorage({
-                                data: $.extend(args.data, {
-                                    returnedHost: json.addhostresponse.host[0]
-                                })
-                            });
+                            //Docker: don't go to addPrimaryStorage
+                            if(data != undefined && data.hypervisor == 'Docker')
{
+                                complete({
+                                    data: args.data
+                                });
+                            } else {
+                                stepFns.addPrimaryStorage({
+                                    data: $.extend(args.data, {
+                                        returnedHost: json.addhostresponse.host[0]
+                                    })
+                                });
+                            }
+                            //Docker: don't go to addPrimaryStorage - end
                         },
                         error: function(XMLHttpResponse) {
                             var errorMsg = parseXMLHttpResponse(XMLHttpResponse);


Mime
View raw message