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 2d4609a
Date Thu, 15 Aug 2013 17:27:13 GMT
Updated Branches:
  refs/heads/4.2 16deb3935 -> 2d4609a8d


CLOUDSTACK-4308: UI > volume page > if hypervisor is KVM, show/hide takeSnapshot, recurringSnapshot
action upon KVMsnapshotenabled property returned by listCapabilities API.


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

Branch: refs/heads/4.2
Commit: 2d4609a8df758b185748d145e29a30829ee92928
Parents: 16deb39
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Aug 15 10:25:32 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu Aug 15 10:27:02 2013 -0700

----------------------------------------------------------------------
 ui/scripts/cloudStack.js      | 11 +++++++++++
 ui/scripts/sharedFunctions.js |  1 +
 ui/scripts/storage.js         |  8 ++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d4609a8/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index df6fea6..7020c21 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -168,6 +168,11 @@
                             expires: 1
                         });
 
+                        g_KVMsnapshotenabled = json.listcapabilitiesresponse.capability.KVMsnapshotenabled;
//boolean
+                        $.cookie('KVMsnapshotenabled', g_KVMsnapshotenabled, {
+                            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,
{
@@ -332,6 +337,11 @@
                                     expires: 1
                                 });
 
+                                g_KVMsnapshotenabled = json.listcapabilitiesresponse.capability.KVMsnapshotenabled;
//boolean
+                                $.cookie('KVMsnapshotenabled', g_KVMsnapshotenabled, {
+                                    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,
{
@@ -432,6 +442,7 @@
                         g_timezoneoffset = null;
                         g_timezone = null;
                         g_supportELB = null;
+                        g_KVMsnapshotenabled = null;
                         g_loginCmdText = null;
 
                         $.cookie('JSESSIONID', null);

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d4609a8/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index d5ede62..a4d00c6 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1865,8 +1865,12 @@
         }
 
         if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
-            allowedActions.push("takeSnapshot");
-            allowedActions.push("recurringSnapshot");
+        	if(jsonObj.hypervisor != 'KVM' 
+        		|| (jsonObj.hypervisor == 'KVM' && g_KVMsnapshotenabled == true) ) {
+	            allowedActions.push("takeSnapshot");
+	            allowedActions.push("recurringSnapshot");
+        	}            
+            
             if (jsonObj.type == "DATADISK") {
                 allowedActions.push("resize");
             }


Mime
View raw message