Skip to content

Commit 6ac7811

Browse files
csuich2bfederle
authored andcommitted
Added quiescevm option to volume snapshot dialog when storage supports it
CLOUDSTACK-5388
1 parent c00cf19 commit 6ac7811

2 files changed

Lines changed: 28 additions & 5 deletions

File tree

‎ui/scripts/storage.js‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,16 +560,39 @@
560560
takeSnapshot: {
561561
label: 'label.action.take.snapshot',
562562
messages: {
563-
confirm: function(args) {
564-
return 'message.action.take.snapshot';
565-
},
566563
notification: function(args) {
567564
return 'label.action.take.snapshot';
568565
}
569566
},
567+
createForm: {
568+
title: 'label.action.take.snapshot',
569+
desc: 'message.action.take.snapshot',
570+
fields: {
571+
quiescevm: {
572+
label: 'Quiesce VM',
573+
isBoolean: true,
574+
isHidden: function(args) {
575+
var hidden = true;
576+
$.ajax({
577+
url: createURL('listStoragePools&id='+args.context.volumes[0].storageid),
578+
dataType: "json",
579+
async: false,
580+
success: function(json) {
581+
if (json.liststoragepoolsresponse.storagepool[0].storagecapabilities.VOLUME_SNAPSHOT_QUIESCEVM == 'true')
582+
hidden = false;
583+
else
584+
hidden = true;
585+
}
586+
});
587+
588+
return hidden;
589+
}
590+
}
591+
}
592+
},
570593
action: function(args) {
571594
$.ajax({
572-
url: createURL("createSnapshot&volumeid=" + args.context.volumes[0].id),
595+
url: createURL("createSnapshot&volumeid=" + args.context.volumes[0].id + "&quiescevm=" + args.context.quiescevm),
573596
dataType: "json",
574597
async: true,
575598
success: function(json) {

‎ui/scripts/ui/dialog.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
if (field.isHidden != null) {
145145
if (typeof(field.isHidden) == 'boolean' && field.isHidden == true)
146146
$formItem.hide();
147-
else if (typeof(field.isHidden) == 'function' && field.isHidden() == true)
147+
else if (typeof(field.isHidden) == 'function' && field.isHidden(args) == true)
148148
$formItem.hide();
149149
}
150150

0 commit comments

Comments
 (0)