incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [37/49] git commit: cloudstack UI - advanced search on volume page - add domain dropdown, account text field.
Date Fri, 05 Oct 2012 22:32:46 GMT
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/f0956a88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/f0956a88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/f0956a88

Branch: refs/heads/maven-to-rpm
Commit: f0956a885255b4fcbc0e8aa30305bb006f49049e
Parents: cd405b4
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Thu Oct 4 13:48:30 2012 -0700
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Sat Oct 6 00:30:26 2012 +0200

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f0956a88/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);						


Mime
View raw message