cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [1/2] git commit: updated refs/heads/4.3 to a2c0abe
Date Fri, 06 Dec 2013 21:09:36 GMT
Updated Branches:
  refs/heads/4.3 c00cf1966 -> a2c0abe98


Added quiescevm option to volume snapshot dialog when storage supports it

CLOUDSTACK-5388


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

Branch: refs/heads/4.3
Commit: 6ac7811274aa31eeef8eead4c7fc4e808af0a147
Parents: c00cf19
Author: Chris Suich <chris.suich@netapp.com>
Authored: Thu Dec 5 15:40:07 2013 -0500
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Fri Dec 6 13:06:47 2013 -0800

----------------------------------------------------------------------
 ui/scripts/storage.js   | 31 +++++++++++++++++++++++++++----
 ui/scripts/ui/dialog.js |  2 +-
 2 files changed, 28 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ac78112/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 4875662..569099d 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -560,16 +560,39 @@
                             takeSnapshot: {
                                 label: 'label.action.take.snapshot',
                                 messages: {
-                                    confirm: function(args) {
-                                        return 'message.action.take.snapshot';
-                                    },
                                     notification: function(args) {
                                         return 'label.action.take.snapshot';
                                     }
                                 },
+                                createForm: {
+                                    title: 'label.action.take.snapshot',
+                                    desc: 'message.action.take.snapshot',
+                                    fields: {
+                                        quiescevm: {
+                                            label: 'Quiesce VM',
+                                            isBoolean: true,
+                                            isHidden: function(args) {
+                                                var hidden = true;
+                                                $.ajax({
+                                                    url: createURL('listStoragePools&id='+args.context.volumes[0].storageid),
+                                                    dataType: "json",
+                                                    async: false,
+                                                    success: function(json) {
+                                                        if (json.liststoragepoolsresponse.storagepool[0].storagecapabilities.VOLUME_SNAPSHOT_QUIESCEVM
== 'true')
+                                                            hidden = false;
+                                                        else
+                                                            hidden = true;
+                                                    }
+                                                });
+
+                                                return hidden;
+                                            }
+                                        }
+                                    }
+                                },
                                 action: function(args) {
                                     $.ajax({
-                                        url: createURL("createSnapshot&volumeid=" + args.context.volumes[0].id),
+                                        url: createURL("createSnapshot&volumeid=" + args.context.volumes[0].id
+ "&quiescevm=" + args.context.quiescevm),
                                         dataType: "json",
                                         async: true,
                                         success: function(json) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ac78112/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 3d34203..cebe167 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -144,7 +144,7 @@
                 if (field.isHidden != null) {
                     if (typeof(field.isHidden) == 'boolean' && field.isHidden ==
true)
                         $formItem.hide();
-                    else if (typeof(field.isHidden) == 'function' && field.isHidden()
== true)
+                    else if (typeof(field.isHidden) == 'function' && field.isHidden(args)
== true)
                         $formItem.hide();
                 }
 


Mime
View raw message