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/462fce35
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/462fce35
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/462fce35

Branch: refs/heads/marvin-parallel
Commit: 462fce35a0e6b3f69017acaf6252e63da6393761
Parents: 5b0e2e0
Author: Jessica Wang <[email protected]>
Authored: Tue Oct 23 14:43:51 2012 -0700
Committer: Prasanna Santhanam <[email protected]>
Committed: Thu Oct 25 13:47:33 2012 +0530

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/462fce35/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;

Reply via email to