cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/master to fb7f5a0
Date Mon, 23 Sep 2013 23:13:20 GMT
Updated Branches:
  refs/heads/master 3e813ce61 -> fb7f5a0a4


CLOUDSTACK-4693: UI > Network > Add Guest Network dialog > physical network dropdown
- populate only physical networks that have Guest traffic type.


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

Branch: refs/heads/master
Commit: fb7f5a0a466dd594929cd12c78c8b865e94ea73c
Parents: 3e813ce
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Sep 23 16:10:36 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Sep 23 16:13:00 2013 -0700

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fb7f5a0a/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 1596973..70dcbcd 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -235,9 +235,9 @@ var addGuestNetworkDialog = {
                     label: 'label.physical.network',
                     dependsOn: 'zoneId',
                     select: function(args) {
-                        if ('physicalNetworks' in args.context) {
+                        if ('physicalNetworks' in args.context) { //Infrastructure menu >
zone detail > guest traffic type > network tab (only shown in advanced zone) > add
guest network dialog
                             addGuestNetworkDialog.physicalNetworkObjs = args.context.physicalNetworks;
-                        } else {
+                        } else { //Network menu > guest network section > add guest
network dialog
                             var selectedZoneId = args.$form.find('.form-item[rel=zoneId]').find('select').val();
                             $.ajax({
                                 url: createURL('listPhysicalNetworks'),
@@ -245,8 +245,33 @@ var addGuestNetworkDialog = {
                                     zoneid: selectedZoneId
                                 },
                                 async: false,
-                                success: function(json) {
-                                    addGuestNetworkDialog.physicalNetworkObjs = json.listphysicalnetworksresponse.physicalnetwork;
+                                success: function(json) {                               
    
+                                	var items = [];
+                                	var physicalnetworks = json.listphysicalnetworksresponse.physicalnetwork;
+                                	if (physicalnetworks != null) {
+                                	    for (var i = 0; i < physicalnetworks.length; i++)
{
+                                	    	$.ajax({
+                                	    		url: createURL('listTrafficTypes'),
+                                	    		data: {
+                                	    			physicalnetworkid: physicalnetworks[i].id
+                                	    		},
+                                	    		async: false,
+                                	    		success: function(json) {                        
       	    			
+                                	    			var traffictypes = json.listtraffictypesresponse.traffictype;
+                                	    			if (traffictypes != null) {
+                                	    				for (var k = 0; k < traffictypes.length; k++)
{
+                                	    					if (traffictypes[k].traffictype == 'Guest') {
+                                	    						items.push(physicalnetworks[i]);
+                                	    						break;
+                                	    					}
+                                	    				}
+                                	    			} 
+                                	    		}
+                                	    	});
+                                	    }	
+                                	}  
+                                	
+                                	addGuestNetworkDialog.physicalNetworkObjs = items;     
                          	
                                 }
                             });
                         }


Mime
View raw message