incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: (1) CS-15057: Remove jquery.timer.js from source code. Replace it with native JavaScript functions.
Date Thu, 21 Jun 2012 19:14:26 GMT
Updated Branches:
  refs/heads/master e7995d09d -> a00c21686


(1) CS-15057: Remove jquery.timer.js from source code. Replace it with native JavaScript functions.

(2) CS-14604: cloudstack 3.0 UI - Add Zone Wizard - skip Guest Traffic step if OVS tunnel manager is enabled.
(3) CS-15311: cloudstack 3.0 UI - Add Zone Wizard - add physical network step - no isolation method dropdown if network type is Basic.
(4) CS-14769:  Don't pass subdomainaccess param when scope=project.
(5) CS-15157: cloudstack 3.0 UI - infrastructure page - physical network - network service providers - reset nspMap before populating listNetworkServiceProviders response to nspMap.


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

Branch: refs/heads/master
Commit: a00c21686f36fa23ec4a2bb2097d806020af64b0
Parents: e7995d0
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Thu Jun 21 12:13:41 2012 -0700
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Thu Jun 21 12:13:41 2012 -0700

----------------------------------------------------------------------
 ui/index.jsp                              |    1 -
 ui/lib/jquery.timers.js                   |  138 ----------
 ui/scripts/system.js                      |  101 ++++----
 ui/scripts/ui-custom/physicalResources.js |    7 +-
 ui/scripts/zoneWizard.js                  |  327 +++++++++++++-----------
 5 files changed, 229 insertions(+), 345 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a00c2168/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index bf02640..3c377ea 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -1584,7 +1584,6 @@
     <script src="lib/jquery-ui/js/jquery-ui.js" type="text/javascript"></script>		
     <script src="lib/date.js" type="text/javascript"></script>
     <script src="lib/jquery.cookies.js" type="text/javascript"></script>
-    <script src="lib/jquery.timers.js" type="text/javascript"></script>
     <script src="lib/jquery.md5.js" type="text/javascript" ></script>
 		
     <script src="lib/excanvas.js"></script>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a00c2168/ui/lib/jquery.timers.js
----------------------------------------------------------------------
diff --git a/ui/lib/jquery.timers.js b/ui/lib/jquery.timers.js
deleted file mode 100644
index bb51157..0000000
--- a/ui/lib/jquery.timers.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * jQuery.timers - Timer abstractions for jQuery
- * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
- * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
- * Date: 2009/10/16
- *
- * @author Blair Mitchelmore
- * @version 1.2
- *
- **/
-
-jQuery.fn.extend({
-	everyTime: function(interval, label, fn, times) {
-		return this.each(function() {
-			jQuery.timer.add(this, interval, label, fn, times);
-		});
-	},
-	oneTime: function(interval, label, fn) {
-		return this.each(function() {
-			jQuery.timer.add(this, interval, label, fn, 1);
-		});
-	},
-	stopTime: function(label, fn) {
-		return this.each(function() {
-			jQuery.timer.remove(this, label, fn);
-		});
-	}
-});
-
-jQuery.extend({
-	timer: {
-		global: [],
-		guid: 1,
-		dataKey: "jQuery.timer",
-		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
-		powers: {
-			// Yeah this is major overkill...
-			'ms': 1,
-			'cs': 10,
-			'ds': 100,
-			's': 1000,
-			'das': 10000,
-			'hs': 100000,
-			'ks': 1000000
-		},
-		timeParse: function(value) {
-			if (value == undefined || value == null)
-				return null;
-			var result = this.regex.exec(jQuery.trim(value.toString()));
-			if (result[2]) {
-				var num = parseFloat(result[1]);
-				var mult = this.powers[result[2]] || 1;
-				return num * mult;
-			} else {
-				return value;
-			}
-		},
-		add: function(element, interval, label, fn, times) {
-			var counter = 0;
-			
-			if (jQuery.isFunction(label)) {
-				if (!times) 
-					times = fn;
-				fn = label;
-				label = interval;
-			}
-			
-			interval = jQuery.timer.timeParse(interval);
-
-			if (typeof interval != 'number' || isNaN(interval) || interval < 0)
-				return;
-
-			if (typeof times != 'number' || isNaN(times) || times < 0) 
-				times = 0;
-			
-			times = times || 0;
-			
-			var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
-			
-			if (!timers[label])
-				timers[label] = {};
-			
-			fn.timerID = fn.timerID || this.guid++;
-			
-			var handler = function() {
-				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
-					jQuery.timer.remove(element, label, fn);
-			};
-			
-			handler.timerID = fn.timerID;
-			
-			if (!timers[label][fn.timerID])
-				timers[label][fn.timerID] = window.setInterval(handler,interval);
-			
-			this.global.push( element );
-			
-		},
-		remove: function(element, label, fn) {
-			var timers = jQuery.data(element, this.dataKey), ret;
-			
-			if ( timers ) {
-				
-				if (!label) {
-					for ( label in timers )
-						this.remove(element, label, fn);
-				} else if ( timers[label] ) {
-					if ( fn ) {
-						if ( fn.timerID ) {
-							window.clearInterval(timers[label][fn.timerID]);
-							delete timers[label][fn.timerID];
-						}
-					} else {
-						for ( var fn in timers[label] ) {
-							window.clearInterval(timers[label][fn]);
-							delete timers[label][fn];
-						}
-					}
-					
-					for ( ret in timers[label] ) break;
-					if ( !ret ) {
-						ret = null;
-						delete timers[label];
-					}
-				}
-				
-				for ( ret in timers ) break;
-				if ( !ret ) 
-					jQuery.removeData(element, this.dataKey);
-			}
-		}
-	}
-});
-
-jQuery(window).bind("unload", function() {
-	jQuery.each(jQuery.timer.global, function(index, item) {
-		jQuery.timer.remove(item);
-	});
-});

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a00c2168/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 33b541d..3e022d2 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -1349,7 +1349,7 @@
 													}
 													else if($form.find('.form-item[rel=projectId]').css("display") != "none") {  //project-specific
 														array1.push("&projectid=" + args.data.projectId);
-														array1.push("&acltype=account");
+														array1.push("&acltype=account");														
 													}
 													else {  //domain-specific
 														array1.push("&acltype=domain");
@@ -1822,7 +1822,7 @@
 							notification: {
 								poll: pollAsyncJobResult
 							}
-						}
+						}						
 					}
         },
         dataProvider: function(args) {
@@ -2484,9 +2484,8 @@
                       dataType: "json",
                       async: true,
                       success: function(json) {
-                        var jobId = json.addnetworkserviceproviderresponse.jobid;
-                        var timerKey = "addNetworkServiceProviderJob_"+jobId;
-                        $("body").everyTime(2000, timerKey, function() {
+                        var jobId = json.addnetworkserviceproviderresponse.jobid;                       
+												var addNetscalerProviderIntervalID = setInterval(function() { 	
                           $.ajax({
                             url: createURL("queryAsyncJobResult&jobId="+jobId),
                             dataType: "json",
@@ -2496,7 +2495,7 @@
                                 return; //Job has not completed
                               }
                               else {
-                                $("body").stopTime(timerKey);
+                                clearInterval(addNetscalerProviderIntervalID); 
                                 if (result.jobstatus == 1) {
                                   nspMap["netscaler"] = result.jobresult.networkserviceprovider;
                                   addExternalLoadBalancer(args, selectedPhysicalNetworkObj, "addNetscalerLoadBalancer", "addnetscalerloadbalancerresponse", "netscalerloadbalancer");
@@ -2511,7 +2510,7 @@
                               alert("addNetworkServiceProvider&name=Netscaler failed. Error: " + errorMsg);
                             }
                           });
-                        });
+                        }, 3000); 		
                       }
                     });
                   }
@@ -2713,9 +2712,8 @@
                       dataType: "json",
                       async: true,
                       success: function(json) {
-                        var jobId = json.addnetworkserviceproviderresponse.jobid;
-                        var timerKey = "addNetworkServiceProviderJob_"+jobId;
-                        $("body").everyTime(2000, timerKey, function() {
+                        var jobId = json.addnetworkserviceproviderresponse.jobid;                        
+												var addF5ProviderIntervalID = setInterval(function() { 	
                           $.ajax({
                             url: createURL("queryAsyncJobResult&jobId="+jobId),
                             dataType: "json",
@@ -2725,7 +2723,7 @@
                                 return; //Job has not completed
                               }
                               else {
-                                $("body").stopTime(timerKey);
+                                clearInterval(addF5ProviderIntervalID); 
                                 if (result.jobstatus == 1) {
                                   nspMap["f5"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
                                   addExternalLoadBalancer(args, selectedPhysicalNetworkObj, "addF5LoadBalancer", "addf5bigiploadbalancerresponse");
@@ -2740,7 +2738,7 @@
                               alert("addNetworkServiceProvider&name=F5BigIpfailed. Error: " + errorMsg);
                             }
                           });
-                        });
+                        }, 3000); 		
                       }
                     });
                   }
@@ -2962,8 +2960,7 @@
                       async: true,
                       success: function(json) {
                         var jobId = json.addnetworkserviceproviderresponse.jobid;
-                        var timerKey = "addNetworkServiceProviderJob_"+jobId;
-                        $("body").everyTime(2000, timerKey, function() {
+                        var addJuniperSRXProviderIntervalID = setInterval(function() { 	
                           $.ajax({
                             url: createURL("queryAsyncJobResult&jobId="+jobId),
                             dataType: "json",
@@ -2973,7 +2970,7 @@
                                 return; //Job has not completed
                               }
                               else {
-                                $("body").stopTime(timerKey);
+                                clearInterval(addJuniperSRXProviderIntervalID); 
                                 if (result.jobstatus == 1) {
                                   nspMap["srx"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
                                   addExternalFirewall(args, selectedPhysicalNetworkObj, "addSrxFirewall", "addsrxfirewallresponse", "srxfirewall");
@@ -2988,7 +2985,7 @@
                               alert("addNetworkServiceProvider&name=JuniperSRX failed. Error: " + errorMsg);
                             }
                           });
-                        });
+                        }, 3000); 		
                       }
                     });
                   }
@@ -5120,9 +5117,8 @@
                     dataType: "json",
                     async: true,
                     success: function(json) {
-                      var jobId = json.addnetworkserviceproviderresponse.jobid;
-                      var timerKey = "addNetworkServiceProviderJob_"+jobId;
-                      $("body").everyTime(2000, timerKey, function() {
+                      var jobId = json.addnetworkserviceproviderresponse.jobid;                      
+											var addNetscalerProviderIntervalID = setInterval(function() { 	
                         $.ajax({
                           url: createURL("queryAsyncJobResult&jobId="+jobId),
                           dataType: "json",
@@ -5132,7 +5128,7 @@
                               return; //Job has not completed
                             }
                             else {
-                              $("body").stopTime(timerKey);
+                              clearInterval(addNetscalerProviderIntervalID); 
                               if (result.jobstatus == 1) {
                                 nspMap["netscaler"] = result.jobresult.networkserviceprovider;
                                 addExternalLoadBalancer(args, selectedPhysicalNetworkObj, "addNetscalerLoadBalancer", "addnetscalerloadbalancerresponse", "netscalerloadbalancer");
@@ -5147,7 +5143,7 @@
                             alert("addNetworkServiceProvider&name=Netscaler failed. Error: " + errorMsg);
                           }
                         });
-                      });
+                      }, 3000); 		
                     }
                   });
                 }
@@ -5314,8 +5310,7 @@
                     async: true,
                     success: function(json) {
                       var jobId = json.addnetworkserviceproviderresponse.jobid;
-                      var timerKey = "addNetworkServiceProviderJob_"+jobId;
-                      $("body").everyTime(2000, timerKey, function() {
+                      var addF5ProviderIntervalID = setInterval(function() { 	
                         $.ajax({
                           url: createURL("queryAsyncJobResult&jobId="+jobId),
                           dataType: "json",
@@ -5325,7 +5320,7 @@
                               return; //Job has not completed
                             }
                             else {
-                              $("body").stopTime(timerKey);
+                              clearInterval(addF5ProviderIntervalID); 
                               if (result.jobstatus == 1) {
                                 nspMap["f5"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
                                 addExternalLoadBalancer(args, selectedPhysicalNetworkObj, "addF5LoadBalancer", "addf5bigiploadbalancerresponse", "f5loadbalancer");
@@ -5340,7 +5335,7 @@
                             alert("addNetworkServiceProvider&name=F5BigIpfailed. Error: " + errorMsg);
                           }
                         });
-                      });
+                      }, 3000); 		
                     }
                   });
                 }
@@ -5524,8 +5519,7 @@
                     async: true,
                     success: function(json) {
                       var jobId = json.addnetworkserviceproviderresponse.jobid;
-                      var timerKey = "addNetworkServiceProviderJob_"+jobId;
-                      $("body").everyTime(2000, timerKey, function() {
+                      var addJuniperSRXProviderIntervalID = setInterval(function() { 	
                         $.ajax({
                           url: createURL("queryAsyncJobResult&jobId="+jobId),
                           dataType: "json",
@@ -5535,7 +5529,7 @@
                               return; //Job has not completed
                             }
                             else {
-                              $("body").stopTime(timerKey);
+                              clearInterval(addJuniperSRXProviderIntervalID); 
                               if (result.jobstatus == 1) {
                                 nspMap["srx"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider;
                                 addExternalFirewall(args, selectedPhysicalNetworkObj, "addSrxFirewall", "addsrxfirewallresponse", "srxfirewall");
@@ -5550,7 +5544,7 @@
                             alert("addNetworkServiceProvider&name=JuniperSRX failed. Error: " + errorMsg);
                           }
                         });
-                      });
+                      }, 3000); 		
                     }
                   });
                 }
@@ -6227,9 +6221,11 @@
                   array1.push("&username=" + todb(args.data.vCenterUsername));
                   array1.push("&password=" + todb(args.data.vCenterPassword));
 
-                  array1.push('&vsmipaddress=' + args.data.vsmipaddress);
-                  array1.push('&vsmusername=' + args.data.vsmusername);
-                  array1.push('&vsmpassword=' + args.data.vsmpassword);
+                  if (args.data.vsmipaddress) {
+                    array1.push('&vsmipaddress=' + args.data.vsmipaddress);
+                    array1.push('&vsmusername=' + args.data.vsmusername);
+                    array1.push('&vsmpassword=' + args.data.vsmpassword);
+                  }
 
                   var hostname = args.data.vCenterHost;
                   var dcName = args.data.vCenterDatacenter;
@@ -6491,7 +6487,7 @@
                   id: 'vSwitches',
                   fields: {
                     vsmdeviceid: { label: 'label.name' },
-                    vsmdevicestate: { label: 'label.state' }
+                    vsmdevicestate: { label: 'label.state',indicator:{ 'Enabled': 'on' } }
                   },
                   detailView: {
                     actions: {
@@ -6517,6 +6513,8 @@
                                   {jobId: jid}
                                 }
                               );
+                              //args.context.vSwitches[0].vsmdevicestate = item.allocationstate;
+                              //addExtraPropertiesToClusterObject(item);
                               args.response.success({
                                 actionFilter: nexusActionfilter,
                                 data:item
@@ -6553,6 +6551,8 @@
                                   {jobId: jid}
                                 }
                               );
+                              //args.context.vSwitches[0].vsmdevicestate = item.allocationstate;
+                              //addExtraPropertiesToClusterObject(item);
                               args.response.success({
                                 actionFilter: nexusActionfilter,
                                 data:item
@@ -6602,7 +6602,7 @@
                           vsmctrlvlanid: { label: 'label.vsmctrlvlanid' },
                           vsmpktvlanid: { label: 'label.vsmpktvlanid' },
                           vsmstoragevlanid: { label: 'label.vsmstoragevlanid' },
-                          vsmdevicestate: { label: 'label.state' }
+                          vsmdevicestate: { label: 'label.state', indicator: { 'Enabled': 'on' } }
                         },
                         
                         dataProvider: function(args) {
@@ -6631,10 +6631,11 @@
                       url: createURL("listCiscoNexusVSMs&clusterid=" + args.context.clusters[0].id),
                       dataType: "json",
                       success: function(json) {
-                        var item = json.listcisconexusvsmscmdresponse.cisconexusvsm;  
+                        var item = json.listcisconexusvsmscmdresponse.cisconexusvsm;
                         args.response.success({
                           actionFilter: nexusActionfilter,
                           data: item
+                         
                         });
                       },
                       error: function(json) {
@@ -8596,8 +8597,7 @@
 			dataType: "json",
 			success: function(json) {
 				var jobId = json.updatephysicalnetworkresponse.jobid;
-				var timerKey = "updatePhysicalNetworkJob_"+jobId;
-				$("body").everyTime(2000, timerKey, function() {
+				var enablePhysicalNetworkIntervalID = setInterval(function() { 	
 					$.ajax({
 						url: createURL("queryAsyncJobResult&jobId="+jobId),
 						dataType: "json",
@@ -8607,7 +8607,7 @@
 								return; //Job has not completed
 							}
 							else {
-								$("body").stopTime(timerKey);
+								clearInterval(enablePhysicalNetworkIntervalID); 
 								if (result.jobstatus == 1) {
 									//alert("updatePhysicalNetwork succeeded.");
 
@@ -8652,8 +8652,7 @@
 										async: false,
 										success: function(json) {
 											var jobId = json.configurevirtualrouterelementresponse.jobid;
-											var timerKey = "configureVirtualRouterElementJob_"+jobId;
-											$("body").everyTime(2000, timerKey, function() {
+											var enableVirtualRouterElementIntervalID = setInterval(function() { 	
 												$.ajax({
 													url: createURL("queryAsyncJobResult&jobId="+jobId),
 													dataType: "json",
@@ -8663,7 +8662,7 @@
 															return; //Job has not completed
 														}
 														else {
-															$("body").stopTime(timerKey);
+															clearInterval(enableVirtualRouterElementIntervalID); 
 															if (result.jobstatus == 1) {
 																//alert("configureVirtualRouterElement succeeded.");
 
@@ -8673,8 +8672,7 @@
 																	async: false,
 																	success: function(json) {
 																		var jobId = json.updatenetworkserviceproviderresponse.jobid;
-																		var timerKey = "updateNetworkServiceProviderJob_"+jobId;
-																		$("body").everyTime(2000, timerKey, function() {
+																		var enableVirtualRouterProviderIntervalID = setInterval(function() { 	
 																			$.ajax({
 																				url: createURL("queryAsyncJobResult&jobId="+jobId),
 																				dataType: "json",
@@ -8684,7 +8682,7 @@
 																						return; //Job has not completed
 																					}
 																					else {
-																						$("body").stopTime(timerKey);
+																						clearInterval(enableVirtualRouterProviderIntervalID); 
 																						if (result.jobstatus == 1) {
 																							//alert("Virtual Router Provider is enabled");
 
@@ -8714,8 +8712,7 @@
 																										async: false,
 																										success: function(json) {
 																											var jobId = json.updatenetworkserviceproviderresponse.jobid;
-																											var timerKey = "updateNetworkServiceProviderJob_"+jobId;
-																											$("body").everyTime(2000, timerKey, function() {
+																											var enableSecurityGroupProviderIntervalID = setInterval(function() { 	
 																												$.ajax({
 																													url: createURL("queryAsyncJobResult&jobId="+jobId),
 																													dataType: "json",
@@ -8725,7 +8722,7 @@
 																															return; //Job has not completed
 																														}
 																														else {
-																															$("body").stopTime(timerKey);
+																															clearInterval(enableSecurityGroupProviderIntervalID); 
 																															if (result.jobstatus == 1) {
 																																//alert("Security group provider is enabled");
 
@@ -8777,7 +8774,7 @@
 																														alert("updateNetworkServiceProvider failed. Error: " + errorMsg);
 																													}
 																												});
-																											});
+																											}, 3000); 		
 																										}
 																									});
 																								}
@@ -8858,7 +8855,7 @@
 																					alert("updateNetworkServiceProvider failed. Error: " + errorMsg);
 																				}
 																			});
-																		});
+																		}, 3000); 		
 																	}
 																});
 															}
@@ -8872,7 +8869,7 @@
 														alert("configureVirtualRouterElement failed. Error: " + errorMsg);
 													}
 												});
-											});
+											}, 3000); 		
 										}
 									});
 								}
@@ -8886,7 +8883,7 @@
 							alert("updatePhysicalNetwork failed. Error: " + errorMsg);
 						}
 					});
-				});
+				}, 3000); 		
 			}
 		});
 	};
@@ -9163,6 +9160,8 @@
 			dataType: "json",
 			async: false,
 			success: function(json) {
+			  nspMap = {}; //reset 
+			
 				var items = json.listnetworkserviceprovidersresponse.networkserviceprovider;	        
         if(items != null) {				
 					for(var i = 0; i < items.length; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a00c2168/ui/scripts/ui-custom/physicalResources.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/physicalResources.js b/ui/scripts/ui-custom/physicalResources.js
index 8acdec6..e531c7b 100644
--- a/ui/scripts/ui-custom/physicalResources.js
+++ b/ui/scripts/ui-custom/physicalResources.js
@@ -82,8 +82,7 @@
               dataType: 'json',
               success: function(json) {
                 var jid = json.uploadcustomcertificateresponse.jobid;
-                var timerKey = "uploadcustomcertificatejob_" + jid;
-                $("body").everyTime(2000, timerKey, function() {
+                var uploadCustomCertificateIntervalID = setInterval(function() { 	
                   $.ajax({
                     url: createURL("queryAsyncJobResult&jobId=" + jid),
                     dataType: "json",
@@ -93,7 +92,7 @@
                         return; //Job has not completed
                       }
                       else {
-                        $("body").stopTime(timerKey);
+                        clearInterval(uploadCustomCertificateIntervalID); 
                         if (result.jobstatus == 1) {
                           cloudStack.dialog.notice({ message: 'Update SSL Certiciate succeeded' });
                         }
@@ -108,7 +107,7 @@
                       $loading.remove();
                     }
                   });
-                });
+                }, 3000); 		
               },
               error: function(XMLHttpResponse) {
                 cloudStack.dialog.notice({ message: 'Failed to update SSL Certificate. ' + parseXMLHttpResponse(XMLHttpResponse) });

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a00c2168/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index d6d1d9f..5843001 100644
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -17,6 +17,7 @@
 	var selectedNetworkOfferingHavingNetscaler = false;
   var returnedPublicVlanIpRanges = []; //public VlanIpRanges returned by API
   var configurationUseLocalStorage = false;
+	var skipGuestTrafficStep = false;
 
   // Makes URL string for traffic label
   var trafficLabelParam = function(trafficTypeID, data, physicalNetworkID) {
@@ -241,15 +242,35 @@
         if (args.data['network-model'] == 'Basic') {
           $('.setup-guest-traffic').addClass('basic');
           $('.setup-guest-traffic').removeClass('advanced');
-        } else {
+					skipGuestTrafficStep = false; //set value
+        } 
+				else {
           $('.setup-guest-traffic').removeClass('basic');
           $('.setup-guest-traffic').addClass('advanced');
+					
+					//skip the step if OVS tunnel manager is enabled	
+          skipGuestTrafficStep = false; //reset it before ajax call
+					$.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) {
+										skipGuestTrafficStep = true;
+									}
+									return false; //break each loop
+								}
+							});						
+						}
+					});	
         }
-
-        return args.data['network-model'] == 'Basic' ||
-          $.grep(args.groupedData.physicalNetworks, function(network) {
-            return $.inArray('guest', network.trafficTypes) > -1;
-          }).length;
+				return !skipGuestTrafficStep;
       },
 
       configureStorageTraffic: function(args) {
@@ -339,17 +360,19 @@
                 url: createURL('listHypervisors'),
                 async: false,
                 data: { listAll: true },
-                success: function(json) {
+                success: function(json) {								 
+									var items = json.listhypervisorsresponse.hypervisor;
+									var array1 = [];
+									if(items != null) {
+									  for(var i = 0; i < items.length; i++) {
+										  if(items[i].name == "XenServer")
+											  array1.unshift({id: items[i].name, description: items[i].name});
+											else
+											  array1.push({id: items[i].name, description: items[i].name});
+										}
+									}								  
                   args.response.success({
-                    data: $.map(
-                      json.listhypervisorsresponse.hypervisor,
-                      function(hypervisor) {
-                        return {
-                          id: hypervisor.name,
-                          description: hypervisor.name
-                        };
-                      }
-                    )
+                    data: array1
                   });
                 }
               });
@@ -1269,7 +1292,7 @@
 
           var returnedPhysicalNetworks = [];
 
-          if(args.data.zone.networkType == "Basic") {
+          if(args.data.zone.networkType == "Basic") { //Basic zone ***
             var requestedTrafficTypeCount = 2; //request guest traffic type, management traffic type
             if(selectedNetworkOfferingHavingSG == true && selectedNetworkOfferingHavingEIP == true && selectedNetworkOfferingHavingELB == true)
               requestedTrafficTypeCount++; //request public traffic type
@@ -1277,9 +1300,7 @@
 						//Basic zone has only one physical network
 						var array1 = [];	            
 						if("physicalNetworks" in args.data) {	//from add-zone-wizard		
-							array1.push("&name=" + todb(args.data.physicalNetworks[0].name));
-							if(args.data.physicalNetworks[0].isolationMethod != null && args.data.physicalNetworks[0].isolationMethod.length > 0)
-								array1.push("&isolationmethods=" + todb(args.data.physicalNetworks[0].isolationMethod));	
+							array1.push("&name=" + todb(args.data.physicalNetworks[0].name));							
 						}
 						else { //from quick-install-wizard
 						  array1.push("&name=PhysicalNetworkInBasicZone");
@@ -1289,9 +1310,8 @@
               url: createURL("createPhysicalNetwork&zoneid=" + args.data.returnedZone.id + array1.join("")),
               dataType: "json",
               success: function(json) {
-                var jobId = json.createphysicalnetworkresponse.jobid;
-                var timerKey = "createPhysicalNetworkJob_" + jobId;
-                $("body").everyTime(2000, timerKey, function(){
+                var jobId = json.createphysicalnetworkresponse.jobid; 
+								var createPhysicalNetworkIntervalID = setInterval(function() { 	
                   $.ajax({
                     url: createURL("queryAsyncJobResult&jobid=" + jobId),
                     dataType: "json",
@@ -1300,8 +1320,9 @@
                       if (result.jobstatus == 0) {
                         return; //Job has not completed
                       }
-                      else {
-                        $("body").stopTime(timerKey);
+                      else {                        
+												clearInterval(createPhysicalNetworkIntervalID); 
+												
                         if (result.jobstatus == 1) {
                           var returnedBasicPhysicalNetwork = result.jobresult.physicalnetwork;
                           var label = returnedBasicPhysicalNetwork.id + trafficLabelParam('guest', data);
@@ -1311,9 +1332,8 @@
                             url: createURL("addTrafficType&trafficType=Guest&physicalnetworkid=" + label),
                             dataType: "json",
                             success: function(json) {
-                              var jobId = json.addtraffictyperesponse.jobid;
-                              var timerKey = "addTrafficTypeJob_" + jobId;
-                              $("body").everyTime(2000, timerKey, function() {
+                              var jobId = json.addtraffictyperesponse.jobid;                              
+															var addGuestTrafficTypeIntervalID = setInterval(function() { 																
                                 $.ajax({
                                   url: createURL("queryAsyncJobResult&jobid=" + jobId),
                                   dataType: "json",
@@ -1322,8 +1342,9 @@
                                     if (result.jobstatus == 0) {
                                       return; //Job has not completed
                                     }
-                                    else {
-                                      $("body").stopTime(timerKey);
+                                    else {                                      
+																			clearInterval(addGuestTrafficTypeIntervalID); 
+																			
                                       if (result.jobstatus == 1) {
                                         returnedTrafficTypes.push(result.jobresult.traffictype);
 
@@ -1346,8 +1367,8 @@
                                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                     alert("Failed to add Guest traffic type to basic zone. Error: " + errorMsg);
                                   }
-                                });
-                              });
+                                });                              
+															}, 3000); 																
                             }
                           });
 
@@ -1357,9 +1378,8 @@
                             url: createURL("addTrafficType&trafficType=Management&physicalnetworkid=" + returnedBasicPhysicalNetwork.id + label),
                             dataType: "json",
                             success: function(json) {
-                              var jobId = json.addtraffictyperesponse.jobid;
-                              var timerKey = "addTrafficTypeJob_" + jobId;
-                              $("body").everyTime(2000, timerKey, function() {
+                              var jobId = json.addtraffictyperesponse.jobid;                             
+															var addManagementTrafficTypeIntervalID = setInterval(function() { 	
                                 $.ajax({
                                   url: createURL("queryAsyncJobResult&jobid=" + jobId),
                                   dataType: "json",
@@ -1368,8 +1388,9 @@
                                     if (result.jobstatus == 0) {
                                       return; //Job has not completed
                                     }
-                                    else {
-                                      $("body").stopTime(timerKey);
+                                    else {                                      
+																			clearInterval(addManagementTrafficTypeIntervalID); 
+																			
                                       if (result.jobstatus == 1) {
                                         returnedTrafficTypes.push(result.jobresult.traffictype);
 
@@ -1392,8 +1413,8 @@
                                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                     alert("Failed to add Management traffic type to basic zone. Error: " + errorMsg);
                                   }
-                                });
-                              });
+                                });                              
+															}, 3000); 	
                             }
                           });
 
@@ -1405,9 +1426,8 @@
                               url: createURL('addTrafficType&physicalnetworkid=' + returnedBasicPhysicalNetwork.id + '&trafficType=Storage' + label),
                               dataType: "json",
                               success: function(json) {
-                                var jobId = json.addtraffictyperesponse.jobid;
-                                var timerKey = "addTrafficTypeJob_" + jobId;
-                                $("body").everyTime(2000, timerKey, function() {
+                                var jobId = json.addtraffictyperesponse.jobid;                                
+																var addStorageTrafficTypeIntervalID = setInterval(function() { 	
                                   $.ajax({
                                     url: createURL("queryAsyncJobResult&jobid=" + jobId),
                                     dataType: "json",
@@ -1416,8 +1436,9 @@
                                       if (result.jobstatus == 0) {
                                         return; //Job has not completed
                                       }
-                                      else {
-                                        $("body").stopTime(timerKey);
+                                      else {                                        
+																				clearInterval(addStorageTrafficTypeIntervalID); 
+																				
                                         if (result.jobstatus == 1) {
                                           returnedTrafficTypes.push(result.jobresult.traffictype);
 
@@ -1440,8 +1461,8 @@
                                       var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                       alert("Failed to add Management traffic type to basic zone. Error: " + errorMsg);
                                     }
-                                  });
-                                });
+                                  });                                
+																}, 3000); 	
                               }
                             });
                           }
@@ -1452,9 +1473,8 @@
                               url: createURL("addTrafficType&trafficType=Public&physicalnetworkid=" + returnedBasicPhysicalNetwork.id + label),
                               dataType: "json",
                               success: function(json) {
-                                var jobId = json.addtraffictyperesponse.jobid;
-                                var timerKey = "addTrafficTypeJob_" + jobId;
-                                $("body").everyTime(2000, timerKey, function() {
+                                var jobId = json.addtraffictyperesponse.jobid;                               
+																var addPublicTrafficTypeIntervalID = setInterval(function() { 	
                                   $.ajax({
                                     url: createURL("queryAsyncJobResult&jobid=" + jobId),
                                     dataType: "json",
@@ -1463,8 +1483,9 @@
                                       if (result.jobstatus == 0) {
                                         return; //Job has not completed
                                       }
-                                      else {
-                                        $("body").stopTime(timerKey);
+                                      else {                                       
+																				clearInterval(addPublicTrafficTypeIntervalID); 
+																				
                                         if (result.jobstatus == 1) {
                                           returnedTrafficTypes.push(result.jobresult.traffictype);
 
@@ -1487,8 +1508,8 @@
                                       var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                       alert("Failed to add Public traffic type to basic zone. Error: " + errorMsg);
                                     }
-                                  });
-                                });
+                                  });                                
+																}, 3000); 	
                               }
                             });
                           }
@@ -1502,8 +1523,9 @@
                       var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                       alert("createPhysicalNetwork failed. Error: " + errorMsg);
                     }
-                  });
-                });
+                  });                
+								}, 3000); 	
+								
               }
             });
           }
@@ -1518,9 +1540,8 @@
                 url: createURL("createPhysicalNetwork&zoneid=" + args.data.returnedZone.id + array1.join("")),
                 dataType: "json",
                 success: function(json) {
-                  var jobId = json.createphysicalnetworkresponse.jobid;
-                  var timerKey = "createPhysicalNetworkJob_" + jobId;
-                  $("body").everyTime(2000, timerKey, function(){
+                  var jobId = json.createphysicalnetworkresponse.jobid;                  
+									var createPhysicalNetworkIntervalID = setInterval(function() { 	
                     $.ajax({
                       url: createURL("queryAsyncJobResult&jobid=" + jobId),
                       dataType: "json",
@@ -1529,8 +1550,9 @@
                         if (result.jobstatus == 0) {
                           return; //Job has not completed
                         }
-                        else {
-                          $("body").stopTime(timerKey);
+                        else {                          
+													clearInterval(createPhysicalNetworkIntervalID); 
+													
                           if (result.jobstatus == 1) {
                             var returnedPhysicalNetwork = result.jobresult.physicalnetwork;
                             returnedPhysicalNetwork.originalId = thisPhysicalNetwork.id;
@@ -1561,9 +1583,8 @@
                                 url: createURL(apiCmd + label),
                                 dataType: "json",
                                 success: function(json) {
-                                  var jobId = json.addtraffictyperesponse.jobid;
-                                  var timerKey = "addTrafficTypeJob_" + jobId;
-                                  $("body").everyTime(2000, timerKey, function() {
+                                  var jobId = json.addtraffictyperesponse.jobid;                                 
+																	var addTrafficTypeIntervalID = setInterval(function() { 	
                                     $.ajax({
                                       url: createURL("queryAsyncJobResult&jobid=" + jobId),
                                       dataType: "json",
@@ -1572,8 +1593,9 @@
                                         if (result.jobstatus == 0) {
                                           return; //Job has not completed
                                         }
-                                        else {
-                                          $("body").stopTime(timerKey);
+                                        else {                                         
+																					clearInterval(addTrafficTypeIntervalID); 
+																					
                                           if (result.jobstatus == 1) {
                                             returnedTrafficTypes.push(result.jobresult.traffictype);
 
@@ -1599,8 +1621,8 @@
                                         var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                         alert(apiCmd + " failed. Error: " + errorMsg);
                                       }
-                                    });
-                                  });
+                                    });                                  
+																	}, 3000); 																		
                                 }
                               });
                             });
@@ -1614,8 +1636,8 @@
                         var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                         alert("createPhysicalNetwork failed. Error: " + errorMsg);
                       }
-                    });
-                  });
+                    });                  
+									}, 3000); 	
                 }
               });
             });
@@ -1630,10 +1652,8 @@
             $.ajax({
               url: createURL("updatePhysicalNetwork&state=Enabled&id=" + args.data.returnedBasicPhysicalNetwork.id),
               dataType: "json",
-              success: function(json) {
-                //var jobId = json.updatephysicalnetworkresponse.jobid;
-                var updatePhysicalNetworkTimer = "updatePhysicalNetworkJob_" + json.updatephysicalnetworkresponse.jobid;
-                $("body").everyTime(2000, updatePhysicalNetworkTimer, function() {
+              success: function(json) { 
+								var enablePhysicalNetworkIntervalID = setInterval(function() { 	
                   $.ajax({
                     url: createURL("queryAsyncJobResult&jobId=" + json.updatephysicalnetworkresponse.jobid),
                     dataType: "json",
@@ -1642,8 +1662,9 @@
                       if (result.jobstatus == 0) {
                         return; //Job has not completed
                       }
-                      else {
-                        $("body").stopTime(updatePhysicalNetworkTimer);
+                      else {                        
+												clearInterval(enablePhysicalNetworkIntervalID); 
+												
                         if (result.jobstatus == 1) {
                           //alert("updatePhysicalNetwork succeeded.");
 
@@ -1686,10 +1707,8 @@
                             url: createURL("configureVirtualRouterElement&enabled=true&id=" + virtualRouterElementId),
                             dataType: "json",
                             async: false,
-                            success: function(json) {
-                              //var jobId = json.configurevirtualrouterelementresponse.jobid;
-                              var configureVirtualRouterElementTimer = "configureVirtualRouterElementJob_" + json.configurevirtualrouterelementresponse.jobid;
-                              $("body").everyTime(2000, configureVirtualRouterElementTimer, function() {
+                            success: function(json) {  
+															var enableVirtualRouterElementIntervalID = setInterval(function() { 	
                                 $.ajax({
                                   url: createURL("queryAsyncJobResult&jobId=" + json.configurevirtualrouterelementresponse.jobid),
                                   dataType: "json",
@@ -1698,8 +1717,9 @@
                                     if (result.jobstatus == 0) {
                                       return; //Job has not completed
                                     }
-                                    else {
-                                      $("body").stopTime(configureVirtualRouterElementTimer);
+                                    else {                                     
+																			clearInterval(enableVirtualRouterElementIntervalID); 
+																			
                                       if (result.jobstatus == 1) {
                                         //alert("configureVirtualRouterElement succeeded.");
 
@@ -1707,10 +1727,8 @@
                                           url: createURL("updateNetworkServiceProvider&state=Enabled&id=" + virtualRouterProviderId),
                                           dataType: "json",
                                           async: false,
-                                          success: function(json) {
-                                            //var jobId = json.updatenetworkserviceproviderresponse.jobid;
-                                            var updateNetworkServiceProviderTimer = "updateNetworkServiceProviderJob_" + json.updatenetworkserviceproviderresponse.jobid;
-                                            $("body").everyTime(2000, updateNetworkServiceProviderTimer, function() {
+                                          success: function(json) {    
+																						var enableVirtualRouterProviderIntervalID = setInterval(function() { 	
                                               $.ajax({
                                                 url: createURL("queryAsyncJobResult&jobId=" + json.updatenetworkserviceproviderresponse.jobid),
                                                 dataType: "json",
@@ -1719,8 +1737,9 @@
                                                   if (result.jobstatus == 0) {
                                                     return; //Job has not completed
                                                   }
-                                                  else {
-                                                    $("body").stopTime(updateNetworkServiceProviderTimer);
+                                                  else {                                                    
+																										clearInterval(enableVirtualRouterProviderIntervalID); 
+																										
                                                     if (result.jobstatus == 1) {
                                                       //alert("Virtual Router Provider is enabled");
 																											
@@ -1752,9 +1771,8 @@
                                                           url: createURL("updateNetworkServiceProvider&state=Enabled&id=" + securityGroupProviderId),
                                                           dataType: "json",
                                                           async: false,
-                                                          success: function(json) {
-                                                            var updateNetworkServiceProviderTimer = "asyncJob_" + json.updatenetworkserviceproviderresponse.jobid;
-                                                            $("body").everyTime(2000, updateNetworkServiceProviderTimer, function() {
+                                                          success: function(json) {                                                            
+																														var enableSecurityGroupProviderIntervalID = setInterval(function() { 	
                                                               $.ajax({
                                                                 url: createURL("queryAsyncJobResult&jobId=" + json.updatenetworkserviceproviderresponse.jobid),
                                                                 dataType: "json",
@@ -1763,8 +1781,9 @@
                                                                   if (result.jobstatus == 0) {
                                                                     return; //Job has not completed
                                                                   }
-                                                                  else {
-                                                                    $("body").stopTime(updateNetworkServiceProviderTimer);
+                                                                  else {                                                                   
+																																		clearInterval(enableSecurityGroupProviderIntervalID); 
+																																		
                                                                     if (result.jobstatus == 1) { //Security group provider has been enabled successfully      
 																																			stepFns.addNetscalerProvider({
 																																				data: args.data
@@ -1779,8 +1798,8 @@
                                                                   var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                                                   alert("failed to enable security group provider. Error: " + errorMsg);
                                                                 }
-                                                              });
-                                                            });
+                                                              });                                                            
+																														}, 3000); 	
                                                           }
                                                         });
                                                       }
@@ -1799,8 +1818,8 @@
                                                   var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                                   alert("failed to enable Virtual Router Provider. Error: " + errorMsg);
                                                 }
-                                              });
-                                            });
+                                              });                                            
+																						}, 3000); 	
                                           }
                                         });
                                       }
@@ -1813,8 +1832,8 @@
                                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                     alert("configureVirtualRouterElement failed. Error: " + errorMsg);
                                   }
-                                });
-                              });
+                                });                              
+															}, 3000); 	
                             }
                           });
                         }
@@ -1827,8 +1846,8 @@
                       var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                       alert("updatePhysicalNetwork failed. Error: " + errorMsg);
                     }
-                  });
-                });
+                  });                
+								}, 3000); 	
               }
             });
           }
@@ -1839,9 +1858,8 @@
                 url: createURL("updatePhysicalNetwork&state=Enabled&id=" + thisPhysicalNetwork.id),
                 dataType: "json",
                 success: function(json) {
-                  var jobId = json.updatephysicalnetworkresponse.jobid;
-                  var timerKey = "updatePhysicalNetworkJob_"+jobId;
-                  $("body").everyTime(2000, timerKey, function() {
+                  var jobId = json.updatephysicalnetworkresponse.jobid;                  						
+									var enablePhysicalNetworkIntervalID = setInterval(function() { 									  
                     $.ajax({
                       url: createURL("queryAsyncJobResult&jobId="+jobId),
                       dataType: "json",
@@ -1850,8 +1868,9 @@
                         if (result.jobstatus == 0) {
                           return; //Job has not completed
                         }
-                        else {
-                          $("body").stopTime(timerKey);
+                        else {		
+													clearInterval(enablePhysicalNetworkIntervalID); 
+													
                           if (result.jobstatus == 1) {
                             //alert("updatePhysicalNetwork succeeded.");
 
@@ -1895,9 +1914,8 @@
                               dataType: "json",
                               async: false,
                               success: function(json) {
-                                var jobId = json.configurevirtualrouterelementresponse.jobid;
-                                var timerKey = "configureVirtualRouterElementJob_"+jobId;
-                                $("body").everyTime(2000, timerKey, function() {
+                                var jobId = json.configurevirtualrouterelementresponse.jobid;                                
+																var enableVirtualRouterElementIntervalID = setInterval(function() { 	
                                   $.ajax({
                                     url: createURL("queryAsyncJobResult&jobId="+jobId),
                                     dataType: "json",
@@ -1906,17 +1924,17 @@
                                       if (result.jobstatus == 0) {
                                         return; //Job has not completed
                                       }
-                                      else {
-                                        $("body").stopTime(timerKey);
+                                      else {                                        
+																				clearInterval(enableVirtualRouterElementIntervalID); 
+																				
                                         if (result.jobstatus == 1) { //configureVirtualRouterElement succeeded
                                           $.ajax({
                                             url: createURL("updateNetworkServiceProvider&state=Enabled&id=" + virtualRouterProviderId),
                                             dataType: "json",
                                             async: false,
                                             success: function(json) {
-                                              var jobId = json.updatenetworkserviceproviderresponse.jobid;
-                                              var timerKey = "updateNetworkServiceProviderJob_"+jobId;
-                                              $("body").everyTime(2000, timerKey, function() {
+                                              var jobId = json.updatenetworkserviceproviderresponse.jobid;                                             
+																							var enableVirtualRouterProviderIntervalID = setInterval(function() { 	
                                                 $.ajax({
                                                   url: createURL("queryAsyncJobResult&jobId="+jobId),
                                                   dataType: "json",
@@ -1925,8 +1943,9 @@
                                                     if (result.jobstatus == 0) {
                                                       return; //Job has not completed
                                                     }
-                                                    else {
-                                                      $("body").stopTime(timerKey);
+                                                    else {                                                      
+																											clearInterval(enableVirtualRouterProviderIntervalID); 
+																											
                                                       if (result.jobstatus == 1) { //Virtual Router Provider has been enabled successfully
                                                         advZoneConfiguredPhysicalNetworkCount++;
                                                         if(advZoneConfiguredPhysicalNetworkCount == args.data.returnedPhysicalNetworks.length) { //not call addPod() until all physical networks get configured
@@ -1944,8 +1963,8 @@
                                                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                                     alert("updateNetworkServiceProvider failed. Error: " + errorMsg);
                                                   }
-                                                });
-                                              });
+                                                });                                              
+																							}, 3000); 	
                                             }
                                           });
                                         }
@@ -1958,8 +1977,8 @@
                                       var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                       alert("configureVirtualRouterElement failed. Error: " + errorMsg);
                                     }
-                                  });
-                                });
+                                  });                                
+																}, 3000); 	
                               }
                             });
                           }
@@ -1972,8 +1991,8 @@
                         var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                         alert("updatePhysicalNetwork failed. Error: " + errorMsg);
                       }
-                    });
-                  });
+                    });                  
+									}, 3000); 		
                 }
               });
             });
@@ -1988,9 +2007,8 @@
 							url: createURL("addNetworkServiceProvider&name=Netscaler&physicalnetworkid=" + args.data.returnedBasicPhysicalNetwork.id),
 							dataType: "json",
 							async: false,
-							success: function(json) {
-								var addNetworkServiceProviderTimer = "asyncJob_" + json.addnetworkserviceproviderresponse.jobid;
-								$("body").everyTime(2000, addNetworkServiceProviderTimer, function() {
+							success: function(json) {								
+								var addNetscalerProviderIntervalID = setInterval(function() { 	                  						
 									$.ajax({
 										url: createURL("queryAsyncJobResult&jobId=" + json.addnetworkserviceproviderresponse.jobid),
 										dataType: "json",
@@ -1999,8 +2017,9 @@
 											if (result.jobstatus == 0) {
 												return; //Job has not completed
 											}
-											else {
-												$("body").stopTime(addNetworkServiceProviderTimer);
+											else {												
+												clearInterval(addNetscalerProviderIntervalID); 
+												
 												if (result.jobstatus == 1) {
 													args.data.returnedNetscalerProvider = result.jobresult.networkserviceprovider;                       
 													stepFns.addNetscalerDevice({
@@ -2018,8 +2037,8 @@
 										}
 									});
 								});
-							}
-						});
+							}						
+						}, 3000); 								
 						//add netscaler provider (end)
 					}
 					else { //selectedNetworkOfferingHavingNetscaler == false
@@ -2125,9 +2144,8 @@
           $.ajax({
             url: createURL("addNetscalerLoadBalancer" + array1.join("")),
             dataType: "json",
-            success: function(json) {
-              var addNetscalerLoadBalancerTimer = "asyncJob_" + json.addnetscalerloadbalancerresponse.jobid;
-              $("body").everyTime(2000, addNetscalerLoadBalancerTimer, function() {
+            success: function(json) {             
+							var addNetscalerLoadBalancerIntervalID = setInterval(function() { 								
                 $.ajax({
                   url: createURL("queryAsyncJobResult&jobid=" + json.addnetscalerloadbalancerresponse.jobid),
                   dataType: "json",
@@ -2136,18 +2154,17 @@
                     if(result.jobstatus == 0) {
                       return;
                     }
-                    else {
-                      $("body").stopTime(addNetscalerLoadBalancerTimer);
+                    else {                      
+											clearInterval(addNetscalerLoadBalancerIntervalID); 
+											
                       if(result.jobstatus == 1) {
                         args.data.returnedNetscalerProvider.returnedNetscalerloadbalancer = result.jobresult.netscalerloadbalancer;
 
                         $.ajax({
                           url: createURL("updateNetworkServiceProvider&state=Enabled&id=" + args.data.returnedNetscalerProvider.id),
                           dataType: "json",
-                          success: function(json) {
-                            var updateNetworkServiceProviderTimer = "asyncJob_" + json.updatenetworkserviceproviderresponse.jobid;
-
-                            $("body").everyTime(2000, updateNetworkServiceProviderTimer, function() {
+                          success: function(json) {                            
+														var enableNetscalerProviderIntervalID = setInterval(function() { 	
                               $.ajax({
                                 url: createURL("queryAsyncJobResult&jobid=" + json.updatenetworkserviceproviderresponse.jobid),
                                 dataType: "json",
@@ -2156,8 +2173,9 @@
                                   if(result.jobstatus == 0) {
                                     return;
                                   }
-                                  else {
-                                    $("body").stopTime(updateNetworkServiceProviderTimer);
+                                  else {                                    
+																		clearInterval(enableNetscalerProviderIntervalID); 
+																		
                                     if(result.jobstatus == 1) {																		 
 																			stepFns.addGuestNetwork({
 																				data: args.data
@@ -2168,8 +2186,8 @@
                                     }
                                   }
                                 }
-                              });
-                            });
+                              });                            
+														}, 3000); 															
                           },
                           error: function(XMLHttpResponse) {
                             var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
@@ -2182,8 +2200,8 @@
                       }
                     }
                   }
-                });
-              });
+                });              
+							}, 3000); 								
             },
             error: function(XMLHttpResponse) {
               var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
@@ -2424,7 +2442,14 @@
           return true;
         },
 
-        configureGuestTraffic: function(args) {
+        configureGuestTraffic: function(args) {		
+					if(skipGuestTrafficStep == true) {
+					  stepFns.addCluster({
+							data: args.data
+						});		
+            return;			
+					}					
+									
           message(dictionary['message.configuring.guest.traffic']);  
 
           if(args.data.returnedZone.networktype == "Basic") {		//create an VlanIpRange for guest network in basic zone
@@ -2488,9 +2513,8 @@
                   url: createURL("updatePhysicalNetwork&id=" + returnedId  + "&vlan=" + todb(vlan)),
                   dataType: "json",
                   success: function(json) {
-                    var jobId = json.updatephysicalnetworkresponse.jobid;
-                    var timerKey = "asyncJob_" + jobId;
-                    $("body").everyTime(2000, timerKey, function(){
+                    var jobId = json.updatephysicalnetworkresponse.jobid;                    
+										var updatePhysicalNetworkVlanIntervalID = setInterval(function() { 											
                       $.ajax({
                         url: createURL("queryAsyncJobResult&jobid=" + jobId),
                         dataType: "json",
@@ -2499,8 +2523,9 @@
                           if(result.jobstatus == 0) {
                             return;
                           }
-                          else {
-                            $("body").stopTime(timerKey);
+                          else {                            
+														clearInterval(updatePhysicalNetworkVlanIntervalID); 
+														
                             if(result.jobstatus == 1) {
                               updatedCount++;
                               if(updatedCount == physicalNetworksHavingGuestIncludingVlan.length) {
@@ -2518,8 +2543,8 @@
                           var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                           error('configureGuestTraffic', errorMsg, { fn: 'configureGuestTraffic', args: args });
                         }
-                      });
-                    });
+                      });                    
+										}, 3000); 	
                   }
                 });
               });


Mime
View raw message