cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/4.2 to 6de00cb
Date Tue, 20 Aug 2013 21:24:47 GMT
Updated Branches:
  refs/heads/4.2 390538168 -> 6de00cb1f


CLOUDSTACK-3950: UI > template/ISO page > registerTemplate/registerISO action > zone
dropdown > include only one option "All Zones" when secondary storage is region-wide.


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

Branch: refs/heads/4.2
Commit: 6de00cb1f2b0f9301fbb2b7975d0803cdcb697a9
Parents: 3905381
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Aug 20 14:22:47 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Tue Aug 20 14:24:34 2013 -0700

----------------------------------------------------------------------
 ui/scripts/cloudStack.js      |  13 +++-
 ui/scripts/sharedFunctions.js |   1 +
 ui/scripts/templates.js       | 124 +++++++++++++++++++++----------------
 3 files changed, 84 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6de00cb1/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index 7020c21..ffc32ad 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -172,7 +172,12 @@
                         $.cookie('KVMsnapshotenabled', g_KVMsnapshotenabled, {
                             expires: 1
                         });                        
-                        
+                                               
+                        g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled;
//boolean
+                        $.cookie('regionsecondaryenabled', g_regionsecondaryenabled, {
+                            expires: 1
+                        }); 
+                                              
                         if (json.listcapabilitiesresponse.capability.userpublictemplateenabled
!= null) {
                             g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString();
//convert boolean to string if it's boolean
                             $.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled,
{
@@ -342,6 +347,11 @@
                                     expires: 1
                                 });   
                                 
+                                g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled;
//boolean
+                                $.cookie('regionsecondaryenabled', g_regionsecondaryenabled,
{
+                                    expires: 1
+                                }); 
+                                
                                 if (json.listcapabilitiesresponse.capability.userpublictemplateenabled
!= null) {
                                     g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString();
//convert boolean to string if it's boolean
                                     $.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled,
{
@@ -443,6 +453,7 @@
                         g_timezone = null;
                         g_supportELB = null;
                         g_KVMsnapshotenabled = null;
+                        g_regionsecondaryenabled = null;
                         g_loginCmdText = null;
 
                         $.cookie('JSESSIONID', null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6de00cb1/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 3a05183..7d55c4f 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -26,6 +26,7 @@ var g_timezoneoffset = null;
 var g_timezone = null;
 var g_supportELB = null;
 var g_KVMsnapshotenabled =  null;
+var g_regionsecondaryenabled = null;
 var g_userPublicTemplateEnabled = "true";
 var g_cloudstackversion = null;
 var g_queryAsyncJobResultInterval = 3000;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6de00cb1/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index d596bc2..0acb36e 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -134,33 +134,42 @@
                                     zone: {
                                         label: 'label.zone',
                                         docID: 'helpRegisterTemplateZone',
-                                        select: function(args) {
-                                            $.ajax({
-                                                url: createURL("listZones&available=true"),
-                                                dataType: "json",
-                                                async: true,
-                                                success: function(json) {
-                                                    var zoneObjs = [];
-                                                    var items = json.listzonesresponse.zone;
-                                                    if (items != null) {
-                                                        for (var i = 0; i < items.length;
i++) {
-                                                            zoneObjs.push({
-                                                                id: items[i].id,
-                                                                description: items[i].name
-                                                            });
-                                                        }
-                                                    }
-                                                    if (isAdmin() && !(cloudStack.context.projects
&& cloudStack.context.projects[0])) {
-                                                        zoneObjs.unshift({
-                                                            id: -1,
-                                                            description: "All Zones"
-                                                        });
-                                                    }
-                                                    args.response.success({
-                                                        data: zoneObjs
-                                                    });
-                                                }
-                                            });
+                                        select: function(args) {                        
               	
+                                        	if(g_regionsecondaryenabled == true) {
+                                        		args.response.success({
+                                                    data: [{
+                                                        id: -1,
+                                                        description: "All Zones"
+                                                    }]
+                                                });                                     
  		
+                                        	} else {                                       
	
+	                                            $.ajax({
+	                                                url: createURL("listZones&available=true"),
+	                                                dataType: "json",
+	                                                async: true,
+	                                                success: function(json) {
+	                                                    var zoneObjs = [];
+	                                                    var items = json.listzonesresponse.zone;
+	                                                    if (items != null) {
+	                                                        for (var i = 0; i < items.length;
i++) {
+	                                                            zoneObjs.push({
+	                                                                id: items[i].id,
+	                                                                description: items[i].name
+	                                                            });
+	                                                        }
+	                                                    }
+	                                                    if (isAdmin() && !(cloudStack.context.projects
&& cloudStack.context.projects[0])) {
+	                                                        zoneObjs.unshift({
+	                                                            id: -1,
+	                                                            description: "All Zones"
+	                                                        });
+	                                                    }
+	                                                    args.response.success({
+	                                                        data: zoneObjs
+	                                                    });
+	                                                }
+	                                            });
+                                        	}
                                         }
                                     },
                                     hypervisor: {
@@ -1033,32 +1042,41 @@
                                         label: 'label.zone',
                                         docID: 'helpRegisterISOZone',
                                         select: function(args) {
-                                            $.ajax({
-                                                url: createURL("listZones&available=true"),
-                                                dataType: "json",
-                                                async: true,
-                                                success: function(json) {
-                                                    var zoneObjs = [];
-                                                    var items = json.listzonesresponse.zone;
-                                                    if (items != null) {
-                                                        for (var i = 0; i < items.length;
i++) {
-                                                            zoneObjs.push({
-                                                                id: items[i].id,
-                                                                description: items[i].name
-                                                            });
-                                                        }
-                                                    }
-                                                    if (isAdmin() && !(cloudStack.context.projects
&& cloudStack.context.projects[0])) {
-                                                        zoneObjs.unshift({
-                                                            id: -1,
-                                                            description: "All Zones"
-                                                        });
-                                                    }
-                                                    args.response.success({
-                                                        data: zoneObjs
-                                                    });
-                                                }
-                                            });
+                                        	if(g_regionsecondaryenabled == true) {
+                                        		args.response.success({
+                                                    data: [{
+                                                        id: -1,
+                                                        description: "All Zones"
+                                                    }]
+                                                });                                     
  		
+                                        	} else {                                       
       	
+	                                            $.ajax({
+	                                                url: createURL("listZones&available=true"),
+	                                                dataType: "json",
+	                                                async: true,
+	                                                success: function(json) {
+	                                                    var zoneObjs = [];
+	                                                    var items = json.listzonesresponse.zone;
+	                                                    if (items != null) {
+	                                                        for (var i = 0; i < items.length;
i++) {
+	                                                            zoneObjs.push({
+	                                                                id: items[i].id,
+	                                                                description: items[i].name
+	                                                            });
+	                                                        }
+	                                                    }
+	                                                    if (isAdmin() && !(cloudStack.context.projects
&& cloudStack.context.projects[0])) {
+	                                                        zoneObjs.unshift({
+	                                                            id: -1,
+	                                                            description: "All Zones"
+	                                                        });
+	                                                    }
+	                                                    args.response.success({
+	                                                        data: zoneObjs
+	                                                    });
+	                                                }
+	                                            });
+                                        	}
                                         }
                                     },
 


Mime
View raw message