You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/10/25 00:08:18 UTC

git commit: CS-16573: cloudstack UI - IP Address page, VPN Customer Gateway page - basic search - encode data passed to API call.

Updated Branches:
  refs/heads/master 47c83ef40 -> 8e2ebb26a


CS-16573: cloudstack UI - IP Address page, VPN Customer Gateway page - basic search - encode data passed to API call.


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

Branch: refs/heads/master
Commit: 8e2ebb26a83c4ce0a5e2656d00ada684ef1ac3d4
Parents: 47c83ef
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Oct 23 14:43:51 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Wed Oct 24 15:07:25 2012 -0700

----------------------------------------------------------------------
 ui/scripts/network.js |   55 +++++++++++++------------------------------
 1 files changed, 17 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/8e2ebb26/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index a813dc4..f437c71 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1311,10 +1311,8 @@
           },
 
           dataProvider: function(args) {
-            var data = {
-              page: args.page,
-              pageSize: pageSize
-            };
+            var data = {};
+						listViewDataProvider(args, data);
 
             if (g_supportELB == "guest") // IPs are allocated on guest network
               $.extend(data, {
@@ -1329,28 +1327,17 @@
 
             if (args.context.networks) {
               $.extend(data, { associatedNetworkId: args.context.networks[0].id });
-            }
 
-            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("vpc" in args.context) {
+              $.extend(data, {
+                vpcid: args.context.vpc[0].id
+              });
             }
-											
-						if("vpc" in args.context) {
-						  $.extend(data, {
-							  vpcid: args.context.vpc[0].id
-							});									
-            }							
-						
+
             $.ajax({
-              url: createURL("listPublicIpAddresses&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
+              url: createURL('listPublicIpAddresses'),
               data: data,
               dataType: "json",
               async: true,
@@ -4200,22 +4187,14 @@
             cidrlist: { label: 'label.CIDR.list' },
             ipsecpsk: { label: 'label.IPsec.preshared.key' }
           },
-          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;
-								}
-							}
-						}
-						
+
+          dataProvider: function(args) {
+					  var data = {};
+						listViewDataProvider(args, data);
+					
             $.ajax({
-              url: createURL("listVpnCustomerGateways&listAll=true&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
-              dataType: "json",
+              url: createURL('listVpnCustomerGateways'),
+              data: data,
               async: true,
               success: function(json) {							  
                 var items = json.listvpncustomergatewaysresponse.vpncustomergateway;