From cddcd01a1a921a44a3f8fd22b90b174a7ef78f74 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 5 Jan 2012 15:06:27 -0800 Subject: [PATCH] cloudstack 3.0 new UI - SystemVM page - implement search. --- ui/scripts/system.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 196ce29d3eb..67884ffbdf7 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -3330,11 +3330,22 @@ } } }, - dataProvider: function(args) { + 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 selectedZoneObj = args.context.physicalResources[0]; - $.ajax({ - url: createURL("listSystemVms&zoneid=" + selectedZoneObj.id + "&page=" + args.page + "&pagesize=" + pageSize), + url: createURL("listSystemVms&zoneid=" + selectedZoneObj.id + "&page=" + args.page + "&pagesize=" + pageSize + array1.join("")), dataType: "json", async: true, success: function(json) {