cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [32/50] [abbrv] git commit: updated refs/heads/vmsync to e2edae1
Date Tue, 18 Jun 2013 03:06:57 GMT
CLOUDSTACK-869: Add VPC dialog - add Public LB Provider dropdown, remove VPC Offering dropdown.
When Public LB Provider is selected as Netscaler, pass "Default VPC offering with Netscaler"
to createVPC API. When Public LB Provider is selected as VpcVirtualRouter, pass "Default VPC
Offering" to createVPC API.


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

Branch: refs/heads/vmsync
Commit: a2c7d3a8a75b2cec266cef566b8828be7a1ebc72
Parents: 952fa24
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Jun 17 10:55:50 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Jun 17 10:58:58 2013 -0700

----------------------------------------------------------------------
 ui/scripts/network.js | 125 +++++++++++++++++++++------------------------
 1 file changed, 57 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a2c7d3a8/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index fb63e4b..ddde9c9 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -4532,78 +4532,67 @@
                     docID: 'helpVPCDomain',
                     label: 'label.DNS.domain.for.guest.networks'
                   },
-
-                  loadbalancer:{        //Support for Netscaler as an external device for
load balancing
-                    label:'Load Balancer',
+                  publicLoadBalancerProvider:{        
+                    label:'Public Load Balancer Provider',
                     select:function(args){
-                         $.ajax({
-                          url:createURL('listVPCOfferings&listall=true'),
-                          dataType:'json',
-                          success:function(json){
-                        var items=[];
-                        var vpcObj = json.listvpcofferingsresponse.vpcoffering;
-                        $(vpcObj).each(function(){
-                          items.push({id:this.id , description:this.name});
-                          });
-                        args.response.success({data:items});
-
-                         }
-
-                     });
-
-                   }
-
-                }
-
+                      var items = [];
+                      items.push({id: 'VpcVirtualRouter', description: 'VpcVirtualRouter'});
+                      items.push({id: 'Netscaler', description: 'Netscaler'});
+                      args.response.success({data: items});
+                    }
+                  }
                 }
               },              
-              action: function(args) {										
-						/*		var defaultvpcofferingid;
-								$.ajax({
-								  url: createURL("listVPCOfferings"),
-									dataType: "json",
-									data: {
-									  isdefault: true
-									},
-								  async: false,
-									success: function(json) {
-									  defaultvpcofferingid = json.listvpcofferingsresponse.vpcoffering[0].id;
-									}
-								});*/
-								
-								var dataObj = {
-									name: args.data.name,
-									displaytext: args.data.displaytext,
-									zoneid: args.data.zoneid,
-									cidr: args.data.cidr,
-									vpcofferingid: args.data.loadbalancer    // Support for external load balancer
-								};
-								
-								if(args.data.networkdomain != null && args.data.networkdomain.length >
0)
-								  $.extend(dataObj, { networkdomain: args.data.networkdomain });								
-								
-								$.ajax({
-                  url: createURL("createVPC"),
-                  dataType: "json",
-									data: dataObj,
-                  async: true,
-                  success: function(json) {
-                    var jid = json.createvpcresponse.jobid;
-                    args.response.success(
-                      {_custom:
-                        {jobId: jid,
-                          getUpdatedItem: function(json) {													  
-                            return json.queryasyncjobresultresponse.jobresult.vpc;
-                          }
+              action: function(args) {	
+                var vpcOfferingName;
+                if (args.data.publicLoadBalancerProvider == 'VpcVirtualRouter')
+                  vpcOfferingName = 'Default VPC offering';
+                else if (args.data.publicLoadBalancerProvider == 'Netscaler')
+                  vpcOfferingName = 'Default VPC  offering with Netscaler';
+                                
+                $.ajax({
+                  url:createURL('listVPCOfferings'),
+                  data: {
+                    name: vpcOfferingName
+                  },                  
+                  success:function(json){   
+                    var vpcofferingid = json.listvpcofferingsresponse.vpcoffering[0].id;
    
+                                       
+                    var dataObj = {
+                      name: args.data.name,
+                      displaytext: args.data.displaytext,
+                      zoneid: args.data.zoneid,
+                      cidr: args.data.cidr,
+                      vpcofferingid: vpcofferingid    
+                    };
+                    
+                    if(args.data.networkdomain != null && args.data.networkdomain.length
> 0)
+                      $.extend(dataObj, { networkdomain: args.data.networkdomain });    
           
+                    
+                    $.ajax({
+                      url: createURL("createVPC"),
+                      dataType: "json",
+                      data: dataObj,
+                      async: true,
+                      success: function(json) {
+                        var jid = json.createvpcresponse.jobid;
+                        args.response.success(
+                          {_custom:
+                            {jobId: jid,
+                              getUpdatedItem: function(json) {                          
 
+                                return json.queryasyncjobresultresponse.jobresult.vpc;
+                              }
+                            }
+                          });
+                      },
+                      error: function(data) {
+                          args.response.error(parseXMLHttpResponse(data));
                         }
-                      });
-                  },
-                  error: function(data) {
-                      args.response.error(parseXMLHttpResponse(data));
-                    }
-                });								
-              },
-             
+                    });     
+                  }
+                });
+                
+              },             
 							notification: {
                 poll: pollAsyncJobResult
               }							


Mime
View raw message