diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 4875662d99a..569099de4a4 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) { diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 3d34203ee9d..cebe16747f7 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(); }