Updated Branches: refs/heads/master ab280d913 -> ea9166248
cloudstack UI - advanced search - implement advanced search on network page. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ea916624 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ea916624 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ea916624 Branch: refs/heads/master Commit: ea91662485a424c5d6b77ac1c44f94afa4022eaa Parents: ab280d9 Author: Jessica Wang <[email protected]> Authored: Wed Oct 3 14:42:49 2012 -0700 Committer: Jessica Wang <[email protected]> Committed: Wed Oct 3 14:49:59 2012 -0700 ---------------------------------------------------------------------- ui/scripts/network.js | 55 ++++++++++++++++++++++++------------ ui/scripts/sharedFunctions.js | 1 + 2 files changed, 38 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ea916624/ui/scripts/network.js ---------------------------------------------------------------------- diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 71f3007..c4306e5 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -191,7 +191,8 @@ url: createURL('listNetworks', { ignoreProject: true }), data: { supportedServices: 'SecurityGroup', - listAll: true + listAll: true, + details: 'min' }, async: false, success: function(data) { @@ -436,24 +437,42 @@ } */ }, - 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; - } - } - } + + advSearchFields: { + zoneid: { + label: 'Zone', + select: function(args) { + $.ajax({ + url: createURL('listZones'), + data: { + listAll: true + }, + success: function(json) { + var zones = json.listzonesresponse.zone; + + args.response.success({ + data: $.map(zones, function(zone) { + return { + id: zone.id, + description: zone.name + }; + }) + }); + } + }); + } + }, + tagKey: { label: 'Tag Key' }, + tagValue: { label: 'Tag Value' } + }, + + dataProvider: function(args) { + var data = {}; + listViewDataProvider(args, data); + $.ajax({ - url: createURL("listNetworks&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), - data: { - listAll: true - }, - dataType: 'json', + url: createURL('listNetworks'), + data: data, async: false, success: function(data) { args.response.success({ http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ea916624/ui/scripts/sharedFunctions.js ---------------------------------------------------------------------- diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 3b5d151..ddeb4b1 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -445,6 +445,7 @@ function listViewDataProvider(args, data) { //pagination $.extend(data, { listAll: true, + details: 'min', page: args.page, pagesize: pageSize });
