mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Added quiescevm option to volume snapshot dialog when storage supports it
CLOUDSTACK-5388
This commit is contained in:
parent
d09d21847c
commit
06344db330
@ -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) {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user