From e234d101a2cd5824f60d7fb3314249df56139128 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 5 Jan 2012 14:10:08 -0800 Subject: [PATCH] cloudstack 3.0 new UI - snapshot page - implement search. --- ui/scripts/storage.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 54398ce8676..f40dcfeaa05 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -1250,8 +1250,20 @@ } }, - dataProvider: function(args) { - var apiCmd = "listSnapshots&page=" + args.page + "&pagesize=" + pageSize; + 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 apiCmd = "listSnapshots&page=" + args.page + "&pagesize=" + pageSize + array1.join(""); if(args.context != null) { if("volumes" in args.context) { apiCmd += "&volumeid=" + args.context.volumes[0].id;