You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/10/04 23:21:35 UTC

git commit: cloudstack UI - advanced search on snapshot page - add domain dropdown, account text field.

Updated Branches:
  refs/heads/master 90f608d21 -> 10d1a0cc6


cloudstack UI - advanced search on snapshot page - add domain dropdown, account text field.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/10d1a0cc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/10d1a0cc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/10d1a0cc

Branch: refs/heads/master
Commit: 10d1a0cc6baec6085236f6b42ae71f0eb1f48c15
Parents: 90f608d
Author: Jessica Wang <je...@citrix.com>
Authored: Thu Oct 4 13:57:50 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Thu Oct 4 13:58:45 2012 -0700

----------------------------------------------------------------------
 ui/scripts/storage.js |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/10d1a0cc/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 8561d25..827cf4e 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1113,7 +1113,46 @@
           },
 
 					advSearchFields: {
-					  name: { label: 'Name' },							
+					  name: { label: 'Name' },	
+            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' }						
 					},