From 1a7dbdc8d963524d3da4ed183b20f277d4e40f4d Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 4 Oct 2012 14:20:15 -0700 Subject: [PATCH] cloudstack UI - advanced search on project page - add domain dropdown, account text field. --- ui/scripts/projects.js | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index 8280cf0bc63..ff47ac8a492 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -646,7 +646,46 @@ } }); } - }, + }, + domainid: { + label: 'Domain', + select: function(args) { + $.ajax({ + url: createURL('listDomains'), + data: { + listAll: true, + details: 'min' + }, + success: function(json) { + var array1 = [{id: '', description: ''}]; + var domains = json.listdomainsresponse.domain; + if(domains != null && domains.length > 0) { + for(var i = 0; i < domains.length; i++) { + array1.push({id: domains[i].id, description: domains[i].path}); + } + } + args.response.success({ + data: array1 + }); + } + }); + }, + isHidden: function(args) { + if(isAdmin() || isDomainAdmin()) + return false; + else + return true; + } + }, + account: { + label: 'Account', + isHidden: function(args) { + if(isAdmin() || isDomainAdmin()) + return false; + else + return true; + } + }, tagKey: { label: 'Tag Key' }, tagValue: { label: 'Tag Value' } },