From bfbf634c0fd4fc2eadcaf15f39cec63f588fe7c4 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 29 Oct 2012 17:03:15 -0700 Subject: [PATCH] CS-16573: cloudstack UI - user page - listView - encode data passed to API call. --- ui/scripts/accounts.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index a74389d505f..0ba3e3ffa7d 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -787,24 +787,19 @@ firstname: { label: 'label.first.name' }, lastname: { label: 'label.last.name' } }, - 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 accountObj = args.context.accounts[0]; + if(isAdmin() || isDomainAdmin()) { + var data = { + domainid: accountObj.domainid, + account: accountObj.name + }; + listViewDataProvider(args, data); + $.ajax({ - url: createURL("listUsers&domainid=" + accountObj.domainid + "&account=" + todb(accountObj.name) + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), - dataType: "json", + url: createURL('listUsers'), + data: data, success: function(json) { args.response.success({ actionFilter: userActionfilter,