diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 09df9ba26c0..100973cac4f 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -234,6 +234,17 @@ args.response.error(); } }); + + $.ajax({ + url: createURL("listSwift"), + dataType: "json", + async: false, + success: function(json) { + var items = json.ListSwiftresponse.swift; + if(items != null && items.length > 0) + havingSwift = true; + } + }); // Get project configuration // TEMPORARY -- replace w/ output of capability response, etc., once implemented diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index e88e2959bf8..ec7baebb099 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -29,6 +29,7 @@ var md5HashedLogin = false; var pageSize = 20; var rootAccountId = 1; +var havingSwift = false; //async action var pollAsyncJobResult = function(args) { diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 4b16f4f81f6..28270773421 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -3386,6 +3386,7 @@ key: args.data.key }, success: function(json) { + havingSwift = true; args.response.success(); }, error: function(json) { diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index b37d7cf0f48..f36b90547ec 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -1518,7 +1518,7 @@ else { allowedActions.push("edit"); - if(jsonObj.zoneid != null || jsonObj.zoneid != "-1") + if(havingSwift == false) allowedActions.push("copyTemplate"); //allowedActions.push("createVm"); // For Beta2, this simply doesn't work without a network. @@ -1560,7 +1560,7 @@ else { allowedActions.push("edit"); - if(jsonObj.zoneid != null || jsonObj.zoneid != "-1") + if(havingSwift == false) allowedActions.push("copyISO"); }