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/31 23:53:17 UTC

git commit: CS-16573: cloudstack UI - update network offering - encode data passed to API call.

Updated Branches:
  refs/heads/master 489b60e3d -> e7fad4199


CS-16573: cloudstack UI - update network offering - 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/e7fad419
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e7fad419
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e7fad419

Branch: refs/heads/master
Commit: e7fad4199488899a3c1914fa00b63bd43ffaf2d1
Parents: 489b60e
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Oct 31 11:53:59 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Wed Oct 31 15:53:04 2012 -0700

----------------------------------------------------------------------
 ui/scripts/configuration.js |   37 +++++++++++++------------------------
 1 files changed, 13 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e7fad419/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 8abf425..dd6b691 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -1072,26 +1072,12 @@
           },
 
           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;
-								}
-							}
-						}
+						var data = {};
+						listViewDataProvider(args, data);		
 					
             $.ajax({
-              url: createURL('listNetworkOfferings' + array1.join("")),
-              data: {
-                page: args.page,
-                pagesize: pageSize
-              },
-              dataType: "json",
-              async: true,
+              url: createURL('listNetworkOfferings'),
+              data: data,
               success: function(json) {
                 var items = json.listnetworkofferingsresponse.networkoffering;
 																
@@ -1787,13 +1773,16 @@
 							edit: {
                 label: 'label.edit',
                 action: function(args) {
-                  var array1 = [];
-                  array1.push("&name=" + todb(args.data.name));
-                  array1.push("&displaytext=" + todb(args.data.displaytext));
-									array1.push("&availability=" + args.data.availability);								
+                  var data = {
+									  id: args.context.networkOfferings[0].id,
+										name: args.data.name,
+										displaytext: args.data.displaytext,
+										availability: args.data.availability
+									};
+                					
                   $.ajax({
-                    url: createURL("updateNetworkOffering&id=" + args.context.networkOfferings[0].id + array1.join("")),
-                    dataType: "json",
+                    url: createURL('updateNetworkOffering'),
+                    data: data,
                     success: function(json) {										 									
 											//if availability is being updated from Required to Optional
 										  if(args.context.networkOfferings[0].availability == "Required" && args.data.availability == "Optional")