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 22:51:18 UTC

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

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


cloudstack UI - advanced search on volume 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/90f608d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/90f608d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/90f608d2

Branch: refs/heads/master
Commit: 90f608d21663212329f28d0f0525840afdd28fc0
Parents: 10a5bda
Author: Jessica Wang <je...@citrix.com>
Authored: Thu Oct 4 13:48:30 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Thu Oct 4 13:50:53 2012 -0700

----------------------------------------------------------------------
 ui/scripts/storage.js |  102 ++++++++++++++++++++++++++++++-------------
 1 files changed, 71 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/90f608d2/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 2e7aac1..8561d25 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -50,35 +50,6 @@
 						*/
           },
 					
-					advSearchFields: {
-					  name: { label: 'Name' },
-						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' }						
-					},
-
           // List view actions
           actions: {
             // Add volume
@@ -294,10 +265,79 @@
               notification: {
                 poll: pollAsyncJobResult
               }
-            }
-							
+            }							
           },
+					
+					advSearchFields: {
+					  name: { label: 'Name' },
+						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
+												};
+											})
+										});
+									}
+								});
+							}						
+						},		
+
+						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' }						
+					},
+					
           dataProvider: function(args) {
 					  var data = {};
 						listViewDataProvider(args, data);