cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [07/11] Apply some formatting to system.js
Date Wed, 08 Jan 2014 16:09:28 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0ba1abe2/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 403fce0..5145dcb 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -15,30 +15,33 @@
 // specific language governing permissions and limitations
 // under the License.
 
-(function($, cloudStack) {
-
+(function ($, cloudStack) {
+    
     var zoneObjs, podObjs, clusterObjs, domainObjs, networkOfferingObjs, physicalNetworkObjs;
     var selectedClusterObj, selectedZoneObj, selectedPublicNetworkObj, selectedManagementNetworkObj, selectedPhysicalNetworkObj, selectedGuestNetworkObj;
-    var nspMap = {}; //from listNetworkServiceProviders API
-    var nspHardcodingArray = []; //for service providers listView (hardcoding, not from listNetworkServiceProviders API)
-
+    var nspMap = {
+    };
+    //from listNetworkServiceProviders API
+    var nspHardcodingArray =[]; //for service providers listView (hardcoding, not from listNetworkServiceProviders API)
+    
     // Add router type to virtual router
     // -- can be either Project, VPC, or System (standard)
-    var mapRouterType = function(index, router) {
+    var mapRouterType = function (index, router) {
         var routerType = _l('label.menu.system');
-
+        
         if (router.projectid) routerType = _l('label.project');
         if (router.vpcid) routerType = 'VPC';
-
+        
         return $.extend(router, {
             routerType: routerType
         });
     };
-
+    
     cloudStack.publicIpRangeAccount = {
-        dialog: function(args) {
-            return function(args) {
-                var data = args.data ? args.data : {};
+        dialog: function (args) {
+            return function (args) {
+                var data = args.data ? args.data: {
+                };
                 var fields = {
                     account: {
                         label: 'Account',
@@ -47,15 +50,15 @@
                     domainid: {
                         label: 'Domain',
                         defaultValue: data.domainid,
-                        select: function(args) {
+                        select: function (args) {
                             $.ajax({
                                 url: createURL('listDomains'),
                                 data: {
                                     listAll: true
                                 },
-                                success: function(json) {
+                                success: function (json) {
                                     args.response.success({
-                                        data: $.map(json.listdomainsresponse.domain, function(domain) {
+                                        data: $.map(json.listdomainsresponse.domain, function (domain) {
                                             return {
                                                 id: domain.id,
                                                 description: domain.path
@@ -68,17 +71,18 @@
                     }
                 };
                 var success = args.response.success;
-
-                if (args.$item) { // Account data is read-only after creation
+                
+                if (args.$item) {
+                    // Account data is read-only after creation
                     $.ajax({
                         url: createURL('listDomains'),
                         data: {
                             id: data.domainid,
                             listAll: true
                         },
-                        success: function(json) {
+                        success: function (json) {
                             var domain = json.listdomainsresponse.domain[0];
-
+                            
                             cloudStack.dialog.notice({
                                 message: '<ul><li>' + _l('label.account') + ': ' + data.account + '</li>' + '<li>' + _l('label.domain') + ': ' + domain.path + '</li></ul>'
                             });
@@ -91,9 +95,9 @@
                             desc: '(optional) Please specify an account to be associated with this IP range.',
                             fields: fields
                         },
-                        after: function(args) {
+                        after: function (args) {
                             var data = cloudStack.serializeForm(args.$form);
-
+                            
                             success({
                                 data: data
                             });
@@ -103,155 +107,158 @@
             };
         }
     };
-
-    var getTrafficType = function(physicalNetwork, typeID) {
-        var trafficType = {};
-
+    
+    var getTrafficType = function (physicalNetwork, typeID) {
+        var trafficType = {
+        };
+        
         $.ajax({
             url: createURL('listTrafficTypes'),
             data: {
                 physicalnetworkid: physicalNetwork.id
             },
             async: false,
-            success: function(json) {
+            success: function (json) {
                 trafficType = $.grep(
-                    json.listtraffictypesresponse.traffictype,
-                    function(trafficType) {
-                        return trafficType.traffictype == typeID;
-                    }
-                )[0];
+                json.listtraffictypesresponse.traffictype,
+                function (trafficType) {
+                    return trafficType.traffictype == typeID;
+                })[0];
             }
         });
-
+        
         if (trafficType.xennetworklabel == null || trafficType.xennetworklabel == 0)
-            trafficType.xennetworklabel = dictionary['label.network.label.display.for.blank.value'];
+        trafficType.xennetworklabel = dictionary[ 'label.network.label.display.for.blank.value'];
         if (trafficType.kvmnetworklabel == null || trafficType.kvmnetworklabel == 0)
-            trafficType.kvmnetworklabel = dictionary['label.network.label.display.for.blank.value'];
+        trafficType.kvmnetworklabel = dictionary[ 'label.network.label.display.for.blank.value'];
         if (trafficType.vmwarenetworklabel == null || trafficType.vmwarenetworklabel == 0)
-            trafficType.vmwarenetworklabel = dictionary['label.network.label.display.for.blank.value'];
+        trafficType.vmwarenetworklabel = dictionary[ 'label.network.label.display.for.blank.value'];
         if (trafficType.ovmnetworklabel == null || trafficType.ovmnetworklabel == 0)
-            trafficType.ovmnetworklabel = dictionary['label.network.label.display.for.blank.value'];
+        trafficType.ovmnetworklabel = dictionary[ 'label.network.label.display.for.blank.value'];
         if (trafficType.lxcnetworklabel == null || trafficType.lxcnetworklabel == 0)
-            trafficType.lxcnetworklabel = dictionary['label.network.label.display.for.blank.value'];
+        trafficType.lxcnetworklabel = dictionary[ 'label.network.label.display.for.blank.value'];
         if (trafficType.hypervnetworklabel == null || trafficType.hypervnetworklabel == 0)
-            trafficType.hypervnetworklabel = dictionary['label.network.label.display.for.blank.value'];
-                
+        trafficType.hypervnetworklabel = dictionary[ 'label.network.label.display.for.blank.value'];
+        
         return trafficType;
     };
-
-    var updateTrafficLabels = function(trafficType, labels, complete) {
-        var array1 = [];
-        if (labels.xennetworklabel != dictionary['label.network.label.display.for.blank.value'])
-            array1.push("&xennetworklabel=" + labels.xennetworklabel);
-        if (labels.kvmnetworklabel != dictionary['label.network.label.display.for.blank.value'])
-            array1.push("&kvmnetworklabel=" + labels.kvmnetworklabel);
-        if (labels.vmwarenetworklabel != dictionary['label.network.label.display.for.blank.value'])
-            array1.push("&vmwarenetworklabel=" + labels.vmwarenetworklabel);
-        if (labels.ovmnetworklabel != dictionary['label.network.label.display.for.blank.value'])
-            array1.push("&ovmnetworklabel=" + labels.ovmnetworklabel);
-        if (labels.lxcnetworklabel != dictionary['label.network.label.display.for.blank.value'])
-            array1.push("&lxcnetworklabel=" + labels.lxcnetworklabel);
-        if (labels.hypervnetworklabel != dictionary['label.network.label.display.for.blank.value'])
-            array1.push("&hypervnetworklabel=" + labels.hypervnetworklabel);        
+    
+    var updateTrafficLabels = function (trafficType, labels, complete) {
+        var array1 =[];
+        if (labels.xennetworklabel != dictionary[ 'label.network.label.display.for.blank.value'])
+        array1.push("&xennetworklabel=" + labels.xennetworklabel);
+        if (labels.kvmnetworklabel != dictionary[ 'label.network.label.display.for.blank.value'])
+        array1.push("&kvmnetworklabel=" + labels.kvmnetworklabel);
+        if (labels.vmwarenetworklabel != dictionary[ 'label.network.label.display.for.blank.value'])
+        array1.push("&vmwarenetworklabel=" + labels.vmwarenetworklabel);
+        if (labels.ovmnetworklabel != dictionary[ 'label.network.label.display.for.blank.value'])
+        array1.push("&ovmnetworklabel=" + labels.ovmnetworklabel);
+        if (labels.lxcnetworklabel != dictionary[ 'label.network.label.display.for.blank.value'])
+        array1.push("&lxcnetworklabel=" + labels.lxcnetworklabel);
+        if (labels.hypervnetworklabel != dictionary[ 'label.network.label.display.for.blank.value'])
+        array1.push("&hypervnetworklabel=" + labels.hypervnetworklabel);
         
         $.ajax({
             url: createURL('updateTrafficType' + array1.join("")),
             data: {
                 id: trafficType.id
             },
-            success: function(json) {
+            success: function (json) {
                 var jobID = json.updatetraffictyperesponse.jobid;
-
+                
                 cloudStack.ui.notifications.add({
-                        desc: 'Update traffic labels',
-                        poll: pollAsyncJobResult,
-                        section: 'System',
-                        _custom: {
-                            jobId: jobID
-                        }
-                    },
-                    complete ? complete : function() {}, {},
-                    function(data) {
-                        // Error
-                        cloudStack.dialog.notice({
-                            message: parseXMLHttpResponse(data)
-                        });
-                    }, {}
-                );
+                    desc: 'Update traffic labels',
+                    poll: pollAsyncJobResult,
+                    section: 'System',
+                    _custom: {
+                        jobId: jobID
+                    }
+                },
+                complete ? complete: function () {
+                },
+                {
+                },
+                function (data) {
+                    // Error
+                    cloudStack.dialog.notice({
+                        message: parseXMLHttpResponse(data)
+                    });
+                },
+                {
+                });
             }
         })
     };
-
+    
     function virtualRouterProviderActionFilter(args) {
-        var allowedActions = [];
+        var allowedActions =[];
         var jsonObj = args.context.item; //args.context.item == nspMap["virtualRouter"]
         if (jsonObj.state == "Enabled")
-            allowedActions.push("disable");
-        else if (jsonObj.state == "Disabled")
-            allowedActions.push("enable");
+        allowedActions.push("disable"); else if (jsonObj.state == "Disabled")
+        allowedActions.push("enable");
         return allowedActions;
     };
-
+    
     cloudStack.sections.system = {
         title: 'label.menu.infrastructure',
         id: 'system',
-
+        
         // System dashboard
         dashboard: {
-            dataProvider: function(args) {
+            dataProvider: function (args) {
                 var dataFns = {
-                    zoneCount: function(data) {
+                    zoneCount: function (data) {
                         $.ajax({
                             url: createURL('listZones'),
-                            success: function(json) {
+                            success: function (json) {
                                 dataFns.podCount($.extend(data, {
-                                    zoneCount: json.listzonesresponse.count ? json.listzonesresponse.count : 0,
+                                    zoneCount: json.listzonesresponse.count ? json.listzonesresponse.count: 0,
                                     zones: json.listzonesresponse.zone
                                 }));
                             }
                         });
                     },
-
-                    podCount: function(data) {
+                    
+                    podCount: function (data) {
                         $.ajax({
                             url: createURL('listPods'),
                             data: {
                                 page: 1,
                                 pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
                             },
-                            success: function(json) {
+                            success: function (json) {
                                 dataFns.clusterCount($.extend(data, {
-                                    podCount: json.listpodsresponse.count ? json.listpodsresponse.count : 0
+                                    podCount: json.listpodsresponse.count ? json.listpodsresponse.count: 0
                                 }));
                             }
                         });
                     },
-
-                    clusterCount: function(data) {
+                    
+                    clusterCount: function (data) {
                         $.ajax({
                             url: createURL('listClusters'),
                             data: {
                                 page: 1,
                                 pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
                             },
-                            success: function(json) {
+                            success: function (json) {
                                 dataFns.hostCount($.extend(data, {
-                                    clusterCount: json.listclustersresponse.count ? json.listclustersresponse.count : 0
+                                    clusterCount: json.listclustersresponse.count ? json.listclustersresponse.count: 0
                                 }));
-
+                                
                                 //comment the 4 lines above and uncomment the following 4 lines if listHosts API still responds slowly.
-
+                                
                                 /*
-                dataFns.primaryStorageCount($.extend(data, {
-                  clusterCount: json.listclustersresponse.count ?
-                    json.listclustersresponse.count : 0
-                }));
-                */
+                                dataFns.primaryStorageCount($.extend(data, {
+                                clusterCount: json.listclustersresponse.count ?
+                                json.listclustersresponse.count : 0
+                                }));
+                                 */
                             }
                         });
                     },
-
-                    hostCount: function(data) {
+                    
+                    hostCount: function (data) {
                         var data2 = {
                             type: 'routing',
                             page: 1,
@@ -260,15 +267,15 @@
                         $.ajax({
                             url: createURL('listHosts'),
                             data: data2,
-                            success: function(json) {
+                            success: function (json) {
                                 dataFns.primaryStorageCount($.extend(data, {
-                                    hostCount: json.listhostsresponse.count ? json.listhostsresponse.count : 0
+                                    hostCount: json.listhostsresponse.count ? json.listhostsresponse.count: 0
                                 }));
                             }
                         });
                     },
-
-                    primaryStorageCount: function(data) {
+                    
+                    primaryStorageCount: function (data) {
                         var data2 = {
                             page: 1,
                             pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
@@ -276,15 +283,15 @@
                         $.ajax({
                             url: createURL('listStoragePools'),
                             data: data2,
-                            success: function(json) {
+                            success: function (json) {
                                 dataFns.secondaryStorageCount($.extend(data, {
-                                    primaryStorageCount: json.liststoragepoolsresponse.count ? json.liststoragepoolsresponse.count : 0
+                                    primaryStorageCount: json.liststoragepoolsresponse.count ? json.liststoragepoolsresponse.count: 0
                                 }));
                             }
                         });
                     },
-
-                    secondaryStorageCount: function(data) {
+                    
+                    secondaryStorageCount: function (data) {
                         var data2 = {
                             type: 'SecondaryStorage',
                             page: 1,
@@ -293,30 +300,30 @@
                         $.ajax({
                             url: createURL('listImageStores'),
                             data: data2,
-                            success: function(json) {
+                            success: function (json) {
                                 dataFns.systemVmCount($.extend(data, {
-                                    secondaryStorageCount: json.listimagestoresresponse.imagestore ? json.listimagestoresresponse.count : 0
+                                    secondaryStorageCount: json.listimagestoresresponse.imagestore ? json.listimagestoresresponse.count: 0
                                 }));
                             }
                         });
                     },
-
-                    systemVmCount: function(data) {
+                    
+                    systemVmCount: function (data) {
                         $.ajax({
                             url: createURL('listSystemVms'),
                             data: {
                                 page: 1,
                                 pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
                             },
-                            success: function(json) {
+                            success: function (json) {
                                 dataFns.virtualRouterCount($.extend(data, {
-                                    systemVmCount: json.listsystemvmsresponse.count ? json.listsystemvmsresponse.count : 0
+                                    systemVmCount: json.listsystemvmsresponse.count ? json.listsystemvmsresponse.count: 0
                                 }));
                             }
                         });
                     },
-
-                    virtualRouterCount: function(data) {
+                    
+                    virtualRouterCount: function (data) {
                         var data2 = {
                             projectid: -1,
                             page: 1,
@@ -325,9 +332,9 @@
                         $.ajax({
                             url: createURL('listRouters'),
                             data: data2,
-                            success: function(json) {
-                                var total1 = json.listroutersresponse.count ? json.listroutersresponse.count : 0;
-
+                            success: function (json) {
+                                var total1 = json.listroutersresponse.count ? json.listroutersresponse.count: 0;
+                                
                                 var data3 = {
                                     listAll: true,
                                     page: 1,
@@ -336,8 +343,8 @@
                                 $.ajax({
                                     url: createURL('listRouters'),
                                     data: data3,
-                                    success: function(json) {
-                                        var total2 = json.listroutersresponse.count ? json.listroutersresponse.count : 0;
+                                    success: function (json) {
+                                        var total2 = json.listroutersresponse.count ? json.listroutersresponse.count: 0;
                                         dataFns.capacity($.extend(data, {
                                             virtualRouterCount: (total1 + total2)
                                         }));
@@ -346,28 +353,28 @@
                             }
                         });
                     },
-
-                    capacity: function(data) {
+                    
+                    capacity: function (data) {
                         if (data.zoneCount) {
                             $.ajax({
                                 url: createURL('listCapacity'),
-                                success: function(json) {
+                                success: function (json) {
                                     var capacities = json.listcapacityresponse.capacity;
-
-                                    var capacityTotal = function(id, converter) {
-                                        var capacity = $.grep(capacities, function(capacity) {
+                                    
+                                    var capacityTotal = function (id, converter) {
+                                        var capacity = $.grep(capacities, function (capacity) {
                                             return capacity.type == id;
                                         })[0];
-
-                                        var total = capacity ? capacity.capacitytotal : 0;
-
+                                        
+                                        var total = capacity ? capacity.capacitytotal: 0;
+                                        
                                         if (converter) {
                                             return converter(total);
                                         }
-
+                                        
                                         return total;
                                     };
-
+                                    
                                     dataFns.socketInfo($.extend(data, {
                                         cpuCapacityTotal: capacityTotal(1, cloudStack.converters.convertHz),
                                         memCapacityTotal: capacityTotal(0, cloudStack.converters.convertBytes),
@@ -383,106 +390,108 @@
                             }));
                         }
                     },
-
-                    socketInfo: function(data) {                    	
-                    	var socketCount = 0;                    	
-                    	$.ajax({
+                    
+                    socketInfo: function (data) {
+                        var socketCount = 0;
+                        $.ajax({
                             url: createURL('listHypervisors'),
                             async: false,
-                            success: function(json) {
+                            success: function (json) {
                                 args.response.success({
-                                    data: $(json.listhypervisorsresponse.hypervisor).map(function(index, hypervisor) {                                              	
-                                    	var totalHostCount = 0;                                                	
-                                    	var currentPage = 1;
-                                    	var returnedHostCount = 0;
-                                    	var returnedHostCpusocketsSum = 0;
-                                    	                                              	
-                                    	var callListHostsWithPage = function(setTotalHostCount) {                                                		
-                                    		$.ajax({
-                            					url: createURL('listHosts'),
-                                        		async: false,
-                                        		data: {
-                                        			type: 'routing',
-                                        			hypervisor: hypervisor.name,
-                                        			page: currentPage,
-                                        	        pagesize: pageSize //global variable
-                                        		},
-                                        		success: function(json) {                                          			
-                                        			if (json.listhostsresponse.count == undefined) {                                        				
-                                        				return;
-                                        			}
-                                        			                                        			
-                                        			if (setTotalHostCount) {
-                                        				totalHostCount = json.listhostsresponse.count;
-                                        			}                                                    			
-                                        			returnedHostCount += json.listhostsresponse.host.length;
-                                        			                                                    			
-                                        			var items = json.listhostsresponse.host;
-                                        			for (var i = 0; i < items.length; i++) {
-                                        				if (items[i].cpusockets != undefined && isNaN(items[i].cpusockets) == false) {
-                                        					returnedHostCpusocketsSum += items[i].cpusockets;
-                                        				} 
-                                        			}  
-                                        			
-                                        			if (returnedHostCount < totalHostCount) {
-                                        				currentPage++;
-                                        				callListHostsWithPage(false);
-                                        			}                                                    			
-                                        		}
-                            				});                                                		
-                                    	}
-                                    	
-                                    	callListHostsWithPage(true);
-                                    	                                    	
-                                    	socketCount += returnedHostCpusocketsSum;                                    	                                    	
+                                    data: $(json.listhypervisorsresponse.hypervisor).map(function (index, hypervisor) {
+                                        var totalHostCount = 0;
+                                        var currentPage = 1;
+                                        var returnedHostCount = 0;
+                                        var returnedHostCpusocketsSum = 0;
+                                        
+                                        var callListHostsWithPage = function (setTotalHostCount) {
+                                            $.ajax({
+                                                url: createURL('listHosts'),
+                                                async: false,
+                                                data: {
+                                                    type: 'routing',
+                                                    hypervisor: hypervisor.name,
+                                                    page: currentPage,
+                                                    pagesize: pageSize //global variable
+                                                },
+                                                success: function (json) {
+                                                    if (json.listhostsresponse.count == undefined) {
+                                                        return;
+                                                    }
+                                                    
+                                                    if (setTotalHostCount) {
+                                                        totalHostCount = json.listhostsresponse.count;
+                                                    }
+                                                    returnedHostCount += json.listhostsresponse.host.length;
+                                                    
+                                                    var items = json.listhostsresponse.host;
+                                                    for (var i = 0; i < items.length; i++) {
+                                                        if (items[i].cpusockets != undefined && isNaN(items[i].cpusockets) == false) {
+                                                            returnedHostCpusocketsSum += items[i].cpusockets;
+                                                        }
+                                                    }
+                                                    
+                                                    if (returnedHostCount < totalHostCount) {
+                                                        currentPage++;
+                                                        callListHostsWithPage(false);
+                                                    }
+                                                }
+                                            });
+                                        }
+                                        
+                                        callListHostsWithPage(true);
+                                        
+                                        socketCount += returnedHostCpusocketsSum;
                                     })
                                 });
                             }
                         });
-                    	
+                        
                         complete($.extend(data, {
                             socketCount: socketCount
                         }));
                     }
                 };
-
-                var complete = function(data) {
+                
+                var complete = function (data) {
                     args.response.success({
                         data: data
                     });
                 };
-
-                dataFns.zoneCount({});
+                
+                dataFns.zoneCount({
+                });
             }
         },
-
-        zoneDashboard: function(args) {
+        
+        zoneDashboard: function (args) {
             $.ajax({
                 url: createURL('listCapacity'),
                 data: {
                     zoneid: args.context.zones[0].id
                 },
-                success: function(json) {
+                success: function (json) {
                     var capacities = json.listcapacityresponse.capacity;
-                    var data = {};
-
-                    $(capacities).each(function() {
+                    var data = {
+                    };
+                    
+                    $(capacities).each(function () {
                         var capacity = this;
-
+                        
                         data[capacity.type] = {
                             used: cloudStack.converters.convertByType(capacity.type, capacity.capacityused),
                             total: cloudStack.converters.convertByType(capacity.type, capacity.capacitytotal),
                             percent: parseInt(capacity.percentused)
                         };
                     });
-
+                    
                     args.response.success({
                         data: data
                     });
                 }
             });
         },
-
+        
         // Network-as-a-service configuration
         naas: {
             providerListView: {
@@ -493,7 +502,7 @@
                     },
                     state: {
                         label: 'label.state',
-                        converter: function(str) {
+                        converter: function (str) {
                             // For localization
                             return str;
                         },
@@ -503,17 +512,16 @@
                         }
                     }
                 },
-                dataProvider: function(args) {
+                dataProvider: function (args) {
                     refreshNspData();
                     args.response.success({
                         data: nspHardcodingArray
                     })
                 },
-
-                detailView: function(args) {
+                
+                detailView: function (args) {
                     return cloudStack.sections.system.naas.networkProviders.types[
-                        args.context.networkProviders[0].id
-                    ];
+                    args.context.networkProviders[0].id];
                 }
             },
             mainNetworks: {
@@ -522,10 +530,10 @@
                         actions: {
                             edit: {
                                 label: 'label.edit',
-                                action: function(args) {
+                                action: function (args) {
                                     var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Public');
-
-                                    updateTrafficLabels(trafficType, args.data, function() {
+                                    
+                                    updateTrafficLabels(trafficType, args.data, function () {
                                         args.response.success();
                                     });
                                 }
@@ -534,14 +542,15 @@
                         tabs: {
                             details: {
                                 title: 'label.details',
-                                fields: [{
+                                fields:[ {
                                     traffictype: {
                                         label: 'label.traffic.type'
                                     },
                                     broadcastdomaintype: {
                                         label: 'label.broadcast.domain.type'
                                     }
-                                }, {
+                                },
+                                {
                                     xennetworklabel: {
                                         label: 'label.xen.traffic.label',
                                         isEditable: true
@@ -567,18 +576,18 @@
                                         isEditable: true
                                     }
                                 }],
-
-                                dataProvider: function(args) {
+                                
+                                dataProvider: function (args) {
                                     $.ajax({
                                         url: createURL("listNetworks&listAll=true&trafficType=Public&isSystem=true&zoneId=" + selectedZoneObj.id),
                                         dataType: "json",
                                         async: false,
-                                        success: function(json) {
+                                        success: function (json) {
                                             var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Public');
                                             var items = json.listnetworksresponse.network;
-
+                                            
                                             selectedPublicNetworkObj = items[0];
-
+                                            
                                             // Include traffic labels
                                             selectedPublicNetworkObj.xennetworklabel = trafficType.xennetworklabel;
                                             selectedPublicNetworkObj.kvmnetworklabel = trafficType.kvmnetworklabel;
@@ -594,10 +603,10 @@
                                     });
                                 }
                             },
-
+                            
                             ipAddresses: {
                                 title: 'label.ip.ranges',
-                                custom: function(args) {
+                                custom: function (args) {
                                     return $('<div></div>').multiEdit({
                                         context: args.context,
                                         noSelect: true,
@@ -637,108 +646,107 @@
                                         },
                                         add: {
                                             label: 'label.add',
-                                            action: function(args) {
-                                                var array1 = [];
+                                            action: function (args) {
+                                                var array1 =[];
                                                 array1.push("&zoneId=" + args.context.zones[0].id);
-
+                                                
                                                 if (args.data.vlan != null && args.data.vlan.length > 0)
-                                                    array1.push("&vlan=" + todb(args.data.vlan));
-                                                else
-                                                    array1.push("&vlan=untagged");
-
+                                                array1.push("&vlan=" + todb(args.data.vlan)); else
+                                                array1.push("&vlan=untagged");
+                                                
                                                 array1.push("&gateway=" + args.data.gateway);
                                                 array1.push("&netmask=" + args.data.netmask);
                                                 array1.push("&startip=" + args.data.startip);
                                                 if (args.data.endip != null && args.data.endip.length > 0)
-                                                    array1.push("&endip=" + args.data.endip);
-
+                                                array1.push("&endip=" + args.data.endip);
+                                                
                                                 if (args.data.account) {
                                                     array1.push("&account=" + args.data.account.account);
                                                     array1.push("&domainid=" + args.data.account.domainid);
                                                 }
-
-                                                array1.push("&forVirtualNetwork=true"); //indicates this new IP range is for public network, not guest network
-
+                                                
+                                                array1.push("&forVirtualNetwork=true");
+                                                //indicates this new IP range is for public network, not guest network
+                                                
                                                 $.ajax({
                                                     url: createURL("createVlanIpRange" + array1.join("")),
                                                     dataType: "json",
-                                                    success: function(json) {
+                                                    success: function (json) {
                                                         var item = json.createvlaniprangeresponse.vlan;
                                                         args.response.success({
                                                             data: item,
                                                             notification: {
                                                                 label: 'label.add.ip.range',
-                                                                poll: function(args) {
+                                                                poll: function (args) {
                                                                     args.complete();
                                                                 }
                                                             }
                                                         });
                                                     },
-                                                    error: function(XMLHttpResponse) {
+                                                    error: function (XMLHttpResponse) {
                                                         var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                                         args.response.error(errorMsg);
                                                     }
                                                 });
                                             }
                                         },
-                                        actionPreFilter: function(args) {
-                                            var actionsToShow = ['destroy'];
+                                        actionPreFilter: function (args) {
+                                            var actionsToShow =[ 'destroy'];
                                             if (args.context.multiRule[0].domain == 'ROOT' && args.context.multiRule[0].account.account == 'system')
-                                                actionsToShow.push('addAccount');
-                                            else
-                                                actionsToShow.push('releaseFromAccount');
+                                            actionsToShow.push('addAccount'); else
+                                            actionsToShow.push('releaseFromAccount');
                                             return actionsToShow;
                                         },
                                         actions: {
                                             destroy: {
                                                 label: 'label.remove.ip.range',
-                                                action: function(args) {
+                                                action: function (args) {
                                                     $.ajax({
                                                         url: createURL('deleteVlanIpRange&id=' + args.context.multiRule[0].id),
                                                         dataType: 'json',
                                                         async: true,
-                                                        success: function(json) {
+                                                        success: function (json) {
                                                             args.response.success({
                                                                 notification: {
                                                                     label: 'label.remove.ip.range',
-                                                                    poll: function(args) {
+                                                                    poll: function (args) {
                                                                         args.complete();
                                                                     }
                                                                 }
                                                             });
                                                         },
-                                                        error: function(json) {
+                                                        error: function (json) {
                                                             args.response.error(parseXMLHttpResponse(json));
                                                         }
                                                     });
                                                 }
                                             },
-
+                                            
                                             releaseFromAccount: {
                                                 label: 'Release from Account',
-                                                action: function(args) {
+                                                action: function (args) {
                                                     $.ajax({
                                                         url: createURL('releasePublicIpRange'),
                                                         data: {
                                                             id: args.context.multiRule[0].id
                                                         },
-                                                        success: function(json) {
+                                                        success: function (json) {
                                                             args.response.success({
                                                                 notification: {
                                                                     label: 'release from account',
-                                                                    poll: function(args) {
+                                                                    poll: function (args) {
                                                                         args.complete();
                                                                     }
                                                                 }
                                                             });
                                                         },
-                                                        error: function(json) {
+                                                        error: function (json) {
                                                             args.response.error(parseXMLHttpResponse(json));
                                                         }
                                                     });
                                                 }
                                             },
-
+                                            
                                             addAccount: {
                                                 label: 'Add Account',
                                                 createForm: {
@@ -749,15 +757,15 @@
                                                         },
                                                         domainid: {
                                                             label: 'Domain',
-                                                            select: function(args) {
+                                                            select: function (args) {
                                                                 $.ajax({
                                                                     url: createURL('listDomains'),
                                                                     data: {
                                                                         listAll: true
                                                                     },
-                                                                    success: function(json) {
+                                                                    success: function (json) {
                                                                         args.response.success({
-                                                                            data: $.map(json.listdomainsresponse.domain, function(domain) {
+                                                                            data: $.map(json.listdomainsresponse.domain, function (domain) {
                                                                                 return {
                                                                                     id: domain.id,
                                                                                     description: domain.path
@@ -770,7 +778,7 @@
                                                         }
                                                     }
                                                 },
-                                                action: function(args) {
+                                                action: function (args) {
                                                     var data = {
                                                         id: args.context.multiRule[0].id,
                                                         zoneid: args.context.multiRule[0].zoneid,
@@ -780,33 +788,32 @@
                                                     $.ajax({
                                                         url: createURL('dedicatePublicIpRange'),
                                                         data: data,
-                                                        success: function(json) {
+                                                        success: function (json) {
                                                             args.response.success({
                                                                 notification: {
                                                                     label: 'Add Account',
-                                                                    poll: function(args) {
+                                                                    poll: function (args) {
                                                                         args.complete();
                                                                     }
                                                                 }
                                                             });
                                                         },
-                                                        error: function(json) {
+                                                        error: function (json) {
                                                             args.response.error(parseXMLHttpResponse(json));
                                                         }
                                                     });
                                                 }
                                             }
-
                                         },
-                                        dataProvider: function(args) {
+                                        dataProvider: function (args) {
                                             $.ajax({
                                                 url: createURL("listVlanIpRanges&zoneid=" + args.context.zones[0].id + "&networkId=" + selectedPublicNetworkObj.id),
                                                 dataType: "json",
-                                                success: function(json) {
+                                                success: function (json) {
                                                     var items = json.listvlaniprangesresponse.vlaniprange;
-
+                                                    
                                                     args.response.success({
-                                                        data: $.map(items, function(item) {
+                                                        data: $.map(items, function (item) {
                                                             return $.extend(item, {
                                                                 account: {
                                                                     _buttonLabel: item.account,
@@ -825,16 +832,16 @@
                         }
                     }
                 },
-
+                
                 'storage': {
                     detailView: {
                         actions: {
                             edit: {
                                 label: 'label.edit',
-                                action: function(args) {
+                                action: function (args) {
                                     var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Storage');
-
-                                    updateTrafficLabels(trafficType, args.data, function() {
+                                    
+                                    updateTrafficLabels(trafficType, args.data, function () {
                                         args.response.success();
                                     });
                                 }
@@ -843,14 +850,15 @@
                         tabs: {
                             details: {
                                 title: 'label.details',
-                                fields: [{
+                                fields:[ {
                                     traffictype: {
                                         label: 'label.traffic.type'
                                     },
                                     broadcastdomaintype: {
                                         label: 'label.broadcast.domain.type'
                                     }
-                                }, {
+                                },
+                                {
                                     xennetworklabel: {
                                         label: 'label.xen.traffic.label',
                                         isEditable: true
@@ -876,17 +884,17 @@
                                         isEditable: true
                                     }
                                 }],
-
-                                dataProvider: function(args) {
+                                
+                                dataProvider: function (args) {
                                     $.ajax({
                                         url: createURL("listNetworks&listAll=true&trafficType=Storage&isSystem=true&zoneId=" + selectedZoneObj.id),
                                         dataType: "json",
                                         async: false,
-                                        success: function(json) {
+                                        success: function (json) {
                                             var items = json.listnetworksresponse.network;
                                             var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Storage');
                                             selectedPublicNetworkObj = items[0];
-
+                                            
                                             selectedPublicNetworkObj.xennetworklabel = trafficType.xennetworklabel;
                                             selectedPublicNetworkObj.kvmnetworklabel = trafficType.kvmnetworklabel;
                                             selectedPublicNetworkObj.vmwarenetworklabel = trafficType.vmwarenetworklabel;
@@ -901,28 +909,29 @@
                                     });
                                 }
                             },
-
+                            
                             ipAddresses: {
                                 title: 'label.ip.ranges',
-                                custom: function(args) {
+                                custom: function (args) {
                                     return $('<div></div>').multiEdit({
                                         context: args.context,
                                         noSelect: true,
                                         fields: {
                                             'podid': {
                                                 label: 'label.pod',
-                                                select: function(args) {
+                                                select: function (args) {
                                                     $.ajax({
                                                         url: createURL("listPods&zoneid=" + selectedZoneObj.id),
                                                         dataType: "json",
-                                                        success: function(json) {
-                                                            var items = [];
+                                                        success: function (json) {
+                                                            var items =[];
                                                             var pods = json.listpodsresponse.pod;
-                                                            $(pods).each(function() {
+                                                            $(pods).each(function () {
                                                                 items.push({
                                                                     name: this.id,
                                                                     description: this.name
-                                                                }); //should be "{id: this.id, description: this.name}" (to be consistent with dropdown in createFrom and edit mode) (Brian will fix widget later)
+                                                                });
+                                                                //should be "{id: this.id, description: this.name}" (to be consistent with dropdown in createFrom and edit mode) (Brian will fix widget later)
                                                             });
                                                             args.response.success({
                                                                 data: items
@@ -959,25 +968,25 @@
                                         },
                                         add: {
                                             label: 'label.add',
-                                            action: function(args) {
-                                                var array1 = [];
+                                            action: function (args) {
+                                                var array1 =[];
                                                 array1.push("&zoneId=" + args.context.zones[0].id);
                                                 array1.push("&podid=" + args.data.podid);
-
+                                                
                                                 array1.push("&gateway=" + args.data.gateway);
-
+                                                
                                                 if (args.data.vlan != null && args.data.vlan.length > 0)
-                                                    array1.push("&vlan=" + todb(args.data.vlan));
-
+                                                array1.push("&vlan=" + todb(args.data.vlan));
+                                                
                                                 array1.push("&netmask=" + args.data.netmask);
                                                 array1.push("&startip=" + args.data.startip);
                                                 if (args.data.endip != null && args.data.endip.length > 0)
-                                                    array1.push("&endip=" + args.data.endip);
-
+                                                array1.push("&endip=" + args.data.endip);
+                                                
                                                 $.ajax({
                                                     url: createURL("createStorageNetworkIpRange" + array1.join("")),
                                                     dataType: "json",
-                                                    success: function(json) {
+                                                    success: function (json) {
                                                         args.response.success({
                                                             _custom: {
                                                                 jobId: json.createstoragenetworkiprangeresponse.jobid
@@ -988,7 +997,7 @@
                                                             }
                                                         });
                                                     },
-                                                    error: function(XMLHttpResponse) {
+                                                    error: function (XMLHttpResponse) {
                                                         var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                                         args.response.error(errorMsg);
                                                     }
@@ -998,16 +1007,16 @@
                                         actions: {
                                             destroy: {
                                                 label: 'label.delete',
-                                                action: function(args) {
+                                                action: function (args) {
                                                     $.ajax({
                                                         url: createURL('deleteStorageNetworkIpRange&id=' + args.context.multiRule[0].id),
                                                         dataType: 'json',
                                                         async: true,
-                                                        success: function(json) {
+                                                        success: function (json) {
                                                             args.response.success({
                                                                 notification: {
                                                                     label: 'label.remove.ip.range',
-                                                                    poll: function(args) {
+                                                                    poll: function (args) {
                                                                         args.complete();
                                                                     }
                                                                 }
@@ -1017,11 +1026,11 @@
                                                 }
                                             }
                                         },
-                                        dataProvider: function(args) {
+                                        dataProvider: function (args) {
                                             $.ajax({
                                                 url: createURL("listStorageNetworkIpRange&zoneid=" + args.context.zones[0].id + "&networkId=" + selectedPublicNetworkObj.id),
                                                 dataType: "json",
-                                                success: function(json) {
+                                                success: function (json) {
                                                     var items = json.liststoragenetworkiprangeresponse.storagenetworkiprange;
                                                     args.response.success({
                                                         data: items
@@ -1035,16 +1044,16 @@
                         }
                     }
                 },
-
+                
                 'management': {
                     detailView: {
                         actions: {
                             edit: {
                                 label: 'label.edit',
-                                action: function(args) {
+                                action: function (args) {
                                     var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Management');
-
-                                    updateTrafficLabels(trafficType, args.data, function() {
+                                    
+                                    updateTrafficLabels(trafficType, args.data, function () {
                                         args.response.success();
                                     });
                                 }
@@ -1053,14 +1062,15 @@
                         tabs: {
                             details: {
                                 title: 'label.details',
-                                fields: [{
+                                fields:[ {
                                     traffictype: {
                                         label: 'label.traffic.type'
                                     },
                                     broadcastdomaintype: {
                                         label: 'label.broadcast.domain.type'
                                     }
-                                }, {
+                                },
+                                {
                                     xennetworklabel: {
                                         label: 'label.xen.traffic.label',
                                         isEditable: true
@@ -1086,15 +1096,15 @@
                                         isEditable: true
                                     }
                                 }],
-                                dataProvider: function(args) {
+                                dataProvider: function (args) {
                                     $.ajax({
                                         url: createURL("listNetworks&listAll=true&issystem=true&trafficType=Management&zoneId=" + selectedZoneObj.id),
                                         dataType: "json",
-                                        success: function(json) {
+                                        success: function (json) {
                                             selectedManagementNetworkObj = json.listnetworksresponse.network[0];
-
+                                            
                                             var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Management');
-
+                                            
                                             selectedManagementNetworkObj.xennetworklabel = trafficType.xennetworklabel;
                                             selectedManagementNetworkObj.kvmnetworklabel = trafficType.kvmnetworklabel;
                                             selectedManagementNetworkObj.vmwarenetworklabel = trafficType.vmwarenetworklabel;
@@ -1109,35 +1119,41 @@
                                     });
                                 }
                             },
-                            ipAddresses: { //read-only listView (no actions) filled with pod info (not VlanIpRange info)
+                            ipAddresses: {
+                                //read-only listView (no actions) filled with pod info (not VlanIpRange info)
                                 title: 'label.ip.ranges',
                                 listView: {
                                     fields: {
                                         name: {
                                             label: 'label.pod'
-                                        }, //pod name
+                                        },
+                                        //pod name
                                         gateway: {
                                             label: 'label.gateway'
-                                        }, //'Reserved system gateway' is too long and causes a visual format bug (2 lines overlay)
+                                        },
+                                        //'Reserved system gateway' is too long and causes a visual format bug (2 lines overlay)
                                         netmask: {
                                             label: 'label.netmask'
-                                        }, //'Reserved system netmask' is too long and causes a visual format bug (2 lines overlay)
+                                        },
+                                        //'Reserved system netmask' is too long and causes a visual format bug (2 lines overlay)
                                         startip: {
                                             label: 'label.start.IP'
-                                        }, //'Reserved system start IP' is too long and causes a visual format bug (2 lines overlay)
+                                        },
+                                        //'Reserved system start IP' is too long and causes a visual format bug (2 lines overlay)
                                         endip: {
                                             label: 'label.end.IP'
-                                        } //'Reserved system end IP' is too long and causes a visual format bug (2 lines overlay)
+                                        }
+                                        //'Reserved system end IP' is too long and causes a visual format bug (2 lines overlay)
                                     },
-                                    dataProvider: function(args) {
-                                        var array1 = [];
+                                    dataProvider: function (args) {
+                                        var array1 =[];
                                         if (args.filterBy != null) {
                                             if (args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) {
                                                 switch (args.filterBy.search.by) {
                                                     case "name":
-                                                        if (args.filterBy.search.value.length > 0)
-                                                            array1.push("&keyword=" + args.filterBy.search.value);
-                                                        break;
+                                                    if (args.filterBy.search.value.length > 0)
+                                                    array1.push("&keyword=" + args.filterBy.search.value);
+                                                    break;
                                                 }
                                             }
                                         }
@@ -1145,7 +1161,7 @@
                                             url: createURL("listPods&zoneid=" + selectedZoneObj.id + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
                                             dataType: "json",
                                             async: true,
-                                            success: function(json) {
+                                            success: function (json) {
                                                 var items = json.listpodsresponse.pod;
                                                 args.response.success({
                                                     data: items
@@ -1158,34 +1174,35 @@
                         }
                     }
                 },
-
-                'guest': { //physical network + Guest traffic type
+                
+                'guest': {
+                    //physical network + Guest traffic type
                     detailView: {
                         actions: {
                             edit: {
                                 label: 'label.edit',
-                                action: function(args) {
+                                action: function (args) {
                                     var data = {
-                                      id: selectedPhysicalNetworkObj.id
+                                        id: selectedPhysicalNetworkObj.id
                                     };
-
-                                  $.extend(data, {
-                                    vlan: args.data.vlan
-                                  });
-
-                                  $.extend(data, {
-                                    tags: args.data.tags
-                                  });
-
+                                    
+                                    $.extend(data, {
+                                        vlan: args.data.vlan
+                                    });
+                                    
+                                    $.extend(data, {
+                                        tags: args.data.tags
+                                    });
+                                    
                                     $.ajax({
                                         url: createURL('updatePhysicalNetwork'),
                                         data: data,
-                                        success: function(json) {
+                                        success: function (json) {
                                             var jobId = json.updatephysicalnetworkresponse.jobid;
-
+                                            
                                             var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Guest');
-
-                                            updateTrafficLabels(trafficType, args.data, function() {
+                                            
+                                            updateTrafficLabels(trafficType, args.data, function () {
                                                 args.response.success({
                                                     _custom: {
                                                         jobId: jobId
@@ -1200,30 +1217,32 @@
                                 }
                             }
                         },
-
-                        tabFilter: function(args) {
-                            var hiddenTabs = [];
+                        
+                        tabFilter: function (args) {
+                            var hiddenTabs =[];
                             if (selectedZoneObj.networktype == 'Basic') {
                                 hiddenTabs.push("network");
                                 hiddenTabs.push("dedicatedGuestVlanRanges");
-                            } else { //selectedZoneObj.networktype == 'Advanced'
+                            } else {
+                                //selectedZoneObj.networktype == 'Advanced'
                                 hiddenTabs.push("ipAddresses");
                             }
                             return hiddenTabs;
                         },
-
+                        
                         tabs: {
                             details: {
                                 title: 'label.details',
-                                preFilter: function(args) {
-                                    var hiddenFields = [];
+                                preFilter: function (args) {
+                                    var hiddenFields =[];
                                     if (selectedZoneObj.networktype == "Basic") {
                                         hiddenFields.push("vlan");
                                         // hiddenFields.push("endVlan");
                                     }
                                     return hiddenFields;
                                 },
-                                fields: [{ //updatePhysicalNetwork API
+                                fields:[ {
+                                    //updatePhysicalNetwork API
                                     state: {
                                         label: 'label.state'
                                     },
@@ -1238,7 +1257,9 @@
                                     broadcastdomainrange: {
                                         label: 'label.broadcast.domain.range'
                                     }
-                                }, { //updateTrafficType API
+                                },
+                                {
+                                    //updateTrafficType API
                                     xennetworklabel: {
                                         label: 'label.xen.traffic.label',
                                         isEditable: true
@@ -1264,7 +1285,8 @@
                                         isEditable: true
                                     }
                                 }],
-                                dataProvider: function(args) { //physical network + Guest traffic type
+                                dataProvider: function (args) {
+                                    //physical network + Guest traffic type
                                     //refresh physical network
                                     $.ajax({
                                         url: createURL('listPhysicalNetworks'),
@@ -1272,37 +1294,38 @@
                                             id: args.context.physicalNetworks[0].id
                                         },
                                         async: true,
-                                        success: function(json) {
+                                        success: function (json) {
                                             selectedPhysicalNetworkObj = json.listphysicalnetworksresponse.physicalnetwork[0];
-
+                                            
                                             //	var startVlan, endVlan;
                                             var vlan = selectedPhysicalNetworkObj.vlan;
                                             /*	if(vlan != null && vlan.length > 0) {
-                        if(vlan.indexOf("-") != -1) {
-                          var vlanArray = vlan.split("-");
-                          startVlan = vlanArray[0];
-                          endVlan = vlanArray[1];
-                        }
-                        else {
-                          startVlan = vlan;
-                        }
-                        selectedPhysicalNetworkObj["startVlan"] = startVlan;
-                        selectedPhysicalNetworkObj["endVlan"] = endVlan;
-                      }*/
-
+                                            if(vlan.indexOf("-") != -1) {
+                                            var vlanArray = vlan.split("-");
+                                            startVlan = vlanArray[0];
+                                            endVlan = vlanArray[1];
+                                            }
+                                            else {
+                                            startVlan = vlan;
+                                            }
+                                            selectedPhysicalNetworkObj["startVlan"] = startVlan;
+                                            selectedPhysicalNetworkObj["endVlan"] = endVlan;
+                                            }*/
+                                            
                                             //traffic type
                                             var xentrafficlabel, kvmtrafficlabel, vmwaretrafficlabel;
-                                            var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Guest'); //refresh Guest traffic type
-                                            selectedPhysicalNetworkObj["xennetworklabel"] = trafficType.xennetworklabel;
-                                            selectedPhysicalNetworkObj["kvmnetworklabel"] = trafficType.kvmnetworklabel;
-                                            selectedPhysicalNetworkObj["vmwarenetworklabel"] = trafficType.vmwarenetworklabel;
-                                            selectedPhysicalNetworkObj["ovmnetworklabel"] = trafficType.ovmnetworklabel;
-                                            selectedPhysicalNetworkObj["lxcnetworklabel"] = trafficType.lxcnetworklabel;
-                                            selectedPhysicalNetworkObj["hypervnetworklabel"] = trafficType.hypervnetworklabel;                                            
+                                            var trafficType = getTrafficType(selectedPhysicalNetworkObj, 'Guest');
+                                            //refresh Guest traffic type
+                                            selectedPhysicalNetworkObj[ "xennetworklabel"] = trafficType.xennetworklabel;
+                                            selectedPhysicalNetworkObj[ "kvmnetworklabel"] = trafficType.kvmnetworklabel;
+                                            selectedPhysicalNetworkObj[ "vmwarenetworklabel"] = trafficType.vmwarenetworklabel;
+                                            selectedPhysicalNetworkObj[ "ovmnetworklabel"] = trafficType.ovmnetworklabel;
+                                            selectedPhysicalNetworkObj[ "lxcnetworklabel"] = trafficType.lxcnetworklabel;
+                                            selectedPhysicalNetworkObj[ "hypervnetworklabel"] = trafficType.hypervnetworklabel;
                                             
                                             args.response.success({
-                                                actionFilter: function() {
-                                                    var allowedActions = ['edit', 'addVlanRange', 'removeVlanRange'];
+                                                actionFilter: function () {
+                                                    var allowedActions =[ 'edit', 'addVlanRange', 'removeVlanRange'];
                                                     return allowedActions;
                                                 },
                                                 data: selectedPhysicalNetworkObj
@@ -1311,28 +1334,29 @@
                                     });
                                 }
                             },
-
+                            
                             ipAddresses: {
                                 title: 'label.ip.ranges',
-                                custom: function(args) {
+                                custom: function (args) {
                                     return $('<div></div>').multiEdit({
                                         context: args.context,
                                         noSelect: true,
                                         fields: {
                                             'podid': {
                                                 label: 'label.pod',
-                                                select: function(args) {
+                                                select: function (args) {
                                                     $.ajax({
                                                         url: createURL("listPods&zoneid=" + selectedZoneObj.id),
                                                         dataType: "json",
-                                                        success: function(json) {
-                                                            var items = [];
+                                                        success: function (json) {
+                                                            var items =[];
                                                             var pods = json.listpodsresponse.pod;
-                                                            $(pods).each(function() {
+                                                            $(pods).each(function () {
                                                                 items.push({
                                                                     name: this.id,
                                                                     description: this.name
-                                                                }); //should be "{id: this.id, description: this.name}" (to be consistent with dropdown in createFrom and edit mode) (Brian will fix widget later)
+                                                                });
+                                                                //should be "{id: this.id, description: this.name}" (to be consistent with dropdown in createFrom and edit mode) (Brian will fix widget later)
                                                             });
                                                             args.response.success({
                                                                 data: items
@@ -1364,33 +1388,34 @@
                                         },
                                         add: {
                                             label: 'label.add',
-                                            action: function(args) {
-                                                var array1 = [];
+                                            action: function (args) {
+                                                var array1 =[];
                                                 array1.push("&podid=" + args.data.podid);
                                                 array1.push("&networkid=" + selectedGuestNetworkObj.id);
                                                 array1.push("&gateway=" + args.data.gateway);
                                                 array1.push("&netmask=" + args.data.netmask);
                                                 array1.push("&startip=" + args.data.startip);
                                                 if (args.data.endip != null && args.data.endip.length > 0)
-                                                    array1.push("&endip=" + args.data.endip);
-                                                array1.push("&forVirtualNetwork=false"); //indicates this new IP range is for guest network, not public network
-
+                                                array1.push("&endip=" + args.data.endip);
+                                                array1.push("&forVirtualNetwork=false");
+                                                //indicates this new IP range is for guest network, not public network
+                                                
                                                 $.ajax({
                                                     url: createURL("createVlanIpRange" + array1.join("")),
                                                     dataType: "json",
-                                                    success: function(json) {
+                                                    success: function (json) {
                                                         var item = json.createvlaniprangeresponse.vlan;
                                                         args.response.success({
                                                             data: item,
                                                             notification: {
                                                                 label: 'label.add.ip.range',
-                                                                poll: function(args) {
+                                                                poll: function (args) {
                                                                     args.complete();
                                                                 }
                                                             }
                                                         });
                                                     },
-                                                    error: function(XMLHttpResponse) {
+                                                    error: function (XMLHttpResponse) {
                                                         var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                                        

<TRUNCATED>

Mime
View raw message