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 013f974
Date Tue, 20 Aug 2013 23:04:15 GMT
Updated Branches:
  refs/heads/4.2 7c45ca209 -> 013f97461


CLOUDSTACK-3950: UI > remove global variable havingS3, havingSwift who are no longer in
use.


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

Branch: refs/heads/4.2
Commit: 013f97461e37f0bb8ffcadfbdd77bd8178c6e3ba
Parents: 7c45ca2
Author: Jessica Wang <jessicawang@apache.org>
Authored: Tue Aug 20 16:03:55 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Tue Aug 20 16:04:05 2013 -0700

----------------------------------------------------------------------
 ui/scripts/cloudStack.js      | 70 +--------------------------------
 ui/scripts/sharedFunctions.js |  2 -
 ui/scripts/system.js          | 80 +++++++++++++++++++++++---------------
 3 files changed, 50 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/013f9746/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index ffc32ad..7846ae8 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -207,40 +207,7 @@
                         return true;
                     }
                 });
-
-                if (userValid && isAdmin()) {
-                    $.ajax({
-                        url: createURL("listImageStores"),
-                        data: {
-                            provider: 'Swift'
-                        },
-                        async: false,
-                        success: function(json) {
-                            var items = json.listimagestoreresponse.imagestore;
-                            if (items != null && items.length > 0)
-                                havingSwift = true;
-                        }
-                    });
-                    if (havingSwift == false) {
-                        $.ajax({
-                            url: createURL("listImageStores"),
-                            data: {
-                                provider: 'S3'
-                            },
-                            async: false,
-                            success: function(json) {
-                                var items = json.listimagestoreresponse.imagestore;
-                                if (items != null && items.length > 0) {
-                                    havingS3 = true;
-                                }
-                            }
-                        });
-                    }
-                } else {
-                    havingSwift = false;
-                    havingS3 = false;
-                }
-
+               
                 return userValid ? {
                     user: {
                         userid: g_userid,
@@ -387,40 +354,7 @@
                                 args.response.error();
                             }
                         });
-
-                        if (isAdmin()) {
-                            $.ajax({
-                                url: createURL("listImageStores"),
-                                data: {
-                                    provider: 'Swift'
-                                },
-                                async: false,
-                                success: function(json) {
-                                    var items = json.listimagestoreresponse.imagestore;
-                                    if (items != null && items.length > 0)
-                                        havingSwift = true;
-                                }
-                            });
-                            if (havingSwift = false) {
-                                $.ajax({
-                                    url: createURL("listImageStores"),
-                                    data: {
-                                        provider: 'S3'
-                                    },
-                                    async: false,
-                                    success: function(json) {
-                                        var items = json.listimagestoreresponse.imagestore;
-                                        if (items != null && items.length > 0)
{
-                                            havingS3 = true;
-                                        }
-                                    }
-                                });
-                            }
-                        } else {
-                            havingSwift = false;
-                            havingS3 = false;
-                        }
-
+                       
                         // Get project configuration
                         // TEMPORARY -- replace w/ output of capability response, etc., once
implemented
                         window.g_projectsInviteRequired = false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/013f9746/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 7d55c4f..3d45ad0 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -48,8 +48,6 @@ var md5HashedLogin = false;
 var pageSize = 20;
 
 var rootAccountId = 1;
-var havingSwift = false;
-var havingS3 = false;
 
 //async action
 var pollAsyncJobResult = function(args) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/013f9746/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 32944d6..68c31e2 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -5619,27 +5619,37 @@
                                     label: 'label.enable.swift',
                                     isHeader: true,
                                     addRow: false,
-                                    preFilter: function(args) {
-                                        var swiftEnabled = false;
-                                        $.ajax({
+                                    preFilter: function(args) {                         
             
+                                    	var swiftEnableConfiguration = false;
+                                    	$.ajax({
                                             url: createURL('listConfigurations'),
                                             data: {
                                                 name: 'swift.enable'
                                             },
                                             async: false,
                                             success: function(json) {
-                                                swiftEnabled = json.listconfigurationsresponse.configuration[0].value
== 'true' && !havingSwift ?
-                                                    true : false;
+                                            	swiftEnableConfiguration = json.listconfigurationsresponse.configuration[0].value
== 'true' ? true : false;
+                                            }
+                                        });
+                                    	
+                                    	var havingSwift = false;
+                                    	$.ajax({
+                                            url: createURL("listImageStores"),
+                                            data: {
+                                                provider: 'Swift'
                                             },
-
-                                            error: function(json) {
-                                                cloudStack.dialog.notice({
-                                                    message: parseXMLHttpResponse(json)
-                                                });
+                                            async: false,
+                                            success: function(json) {
+                                                var items = json.listimagestoreresponse.imagestore;
+                                                if (items != null && items.length
> 0)
+                                                    havingSwift = true;
                                             }
                                         });
-
-                                        return swiftEnabled;
+                                    	
+                                    	if(swiftEnableConfiguration == true && havingSwift
== false)
+                                    		return true;
+                                    	else
+                                    		return false;     
                                     },
                                     messages: {
                                         notification: function(args) {
@@ -5675,8 +5685,7 @@
                                                 username: args.data.username,
                                                 key: args.data.key
                                             },
-                                            success: function(json) {
-                                                havingSwift = true;
+                                            success: function(json) {                   
                            
                                                 args.response.success();
 
                                                 cloudStack.dialog.notice({
@@ -5695,8 +5704,8 @@
                                     isHeader: true,
                                     addRow: false,
 
-                                    preFilter: function(args) {
-                                        var s3Enabled = false;
+                                    preFilter: function(args) {                         
          	
+                                    	var s3EnableConfiguration = false;
                                         $.ajax({
                                             url: createURL('listConfigurations'),
                                             data: {
@@ -5704,17 +5713,29 @@
                                             },
                                             async: false,
                                             success: function(json) {
-                                                s3Enabled = json.listconfigurationsresponse.configuration[0].value
== 'true' && !havingS3 ?
-                                                    true : false;
+                                            	s3EnableConfiguration = json.listconfigurationsresponse.configuration[0].value
== 'true' ? true : false;                                                
+                                            }
+                                        });
+                                        
+                                    	var havingS3 = false;
+                                    	$.ajax({
+                                            url: createURL("listImageStores"),
+                                            data: {
+                                                provider: 'S3'
                                             },
-                                            error: function(json) {
-                                                cloudStack.dialog.notice({
-                                                    message: parseXMLHttpResponse(json)
-                                                });
+                                            async: false,
+                                            success: function(json) {
+                                                var items = json.listimagestoreresponse.imagestore;
+                                                if (items != null && items.length
> 0) {
+                                                    havingS3 = true;
+                                                }
                                             }
                                         });
-
-                                        return s3Enabled;
+                                    	
+                                    	if(s3EnableConfiguration == true && havingS3
== false)
+                                    		return true;
+                                    	else
+                                    		return false;
                                     },
 
                                     messages: {
@@ -5778,8 +5799,7 @@
                                                 maxerrorretry: args.data.maxerrorretry,
                                                 sockettimeout: args.data.sockettimeout
                                             },
-                                            success: function(json) {
-                                                havingS3 = true;
+                                            success: function(json) {                   
                            
                                                 args.response.success();
 
                                                 cloudStack.dialog.notice({
@@ -14543,9 +14563,7 @@
                                             $.ajax({
                                                 url: createURL('addImageStore'),
                                                 data: data,
-                                                success: function(json) {
-                                                    havingS3 = true;
-                                                    
+                                                success: function(json) {               
                                    
                                                     g_regionsecondaryenabled = true;
                                                 	
                                                     var item = json.addimagestoreresponse.imagestore;
@@ -14606,9 +14624,7 @@
                                             $.ajax({
                                                 url: createURL('addImageStore'),
                                                 data: data,
-                                                success: function(json) {
-                                                    havingSwift = true;
-                                                    
+                                                success: function(json) {               
                                    
                                                     g_regionsecondaryenabled = true;
                                                 	
                                                     var item = json.addimagestoreresponse.imagestore;


Mime
View raw message