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:26:58 UTC

git commit: CS-16573: cloudstack UI - global settings page, Hypervisor Capabilities page - encode data passed to API call.

Updated Branches:
  refs/heads/master ae79a1ebb -> b2656b5ce


CS-16573: cloudstack UI - global settings page, Hypervisor Capabilities page - 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/b2656b5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b2656b5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b2656b5c

Branch: refs/heads/master
Commit: b2656b5ce2204117ec9c8bb741bc4231bf6c61c8
Parents: ae79a1e
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Oct 30 16:10:23 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Wed Oct 31 15:26:44 2012 -0700

----------------------------------------------------------------------
 ui/scripts/globalSettings.js |   47 +++++++++++++++----------------------
 1 files changed, 19 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b2656b5c/ui/scripts/globalSettings.js
----------------------------------------------------------------------
diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js
index 0ae73ca..e65a00b 100644
--- a/ui/scripts/globalSettings.js
+++ b/ui/scripts/globalSettings.js
@@ -30,16 +30,14 @@
           actions: {
             edit: {
               label: 'label.change.value',
-              action: function(args) {           
-                var name = args.data.jsonObj.name;
-                var value = args.data.value;
-
+              action: function(args) {    
+								var data = {
+								  name: args.data.jsonObj.name,
+									value: args.data.value
+								};								
                 $.ajax({
-                  url: createURL(
-                    'updateConfiguration&name=' + name + '&value=' + value
-                  ),
-                  dataType: 'json',
-                  async: true,
+                  url: createURL('updateConfiguration'),
+                  data: data,                  
                   success: function(json) {                
                     var item = json.updateconfigurationresponse.configuration;
                     if(item.category == "Usage")
@@ -95,22 +93,12 @@
             maxguestslimit: { label: 'label.max.guest.limit' }
           },
           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("listHypervisorCapabilities&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
-              dataType: "json",
-              async: true,
+              url: createURL('listHypervisorCapabilities'),
+              data: data,              
               success: function(json) {
                 var items = json.listhypervisorcapabilitiesresponse.hypervisorCapabilities;
                 args.response.success({data:items});
@@ -127,11 +115,14 @@
               edit: {
                 label: 'label.edit',
                 action: function(args) {
-                  var array1 = [];
-                  array1.push("&maxguestslimit=" + todb(args.data.maxguestslimit));
+                  var data = {
+									  id: args.context.hypervisorCapabilities[0].id,
+										maxguestslimit: args.data.maxguestslimit
+									};
+                  
                   $.ajax({
-                    url: createURL("updateHypervisorCapabilities&id=" + args.context.hypervisorCapabilities[0].id + array1.join("")),
-                    dataType: "json",
+                    url: createURL('updateHypervisorCapabilities'),
+                    data: data,
                     success: function(json) {
                       var item = json.updatehypervisorcapabilitiesresponse['null'];
                       args.response.success({data: item});