mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5840: UI > Snapshots > create volume from snapshot dialog > add zone dropdown if region-wide secondary storage exists.
This commit is contained in:
parent
9a4a2911da
commit
277b93c19c
|
|
@ -1744,13 +1744,50 @@
|
|||
createForm: {
|
||||
title: 'label.action.create.volume',
|
||||
desc: '',
|
||||
preFilter: function(args) {
|
||||
debugger;
|
||||
if (g_regionsecondaryenabled == true) {
|
||||
args.$form.find('.form-item[rel=zoneid]').css('display', 'inline-block');
|
||||
} else {
|
||||
args.$form.find('.form-item[rel=zoneid]').hide();
|
||||
}
|
||||
},
|
||||
fields: {
|
||||
name: {
|
||||
label: 'label.name',
|
||||
validation: {
|
||||
required: true
|
||||
}
|
||||
}
|
||||
},
|
||||
zoneid: {
|
||||
label: 'label.availability.zone',
|
||||
isHidden: true,
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("listZones&available=true"),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var zoneObjs = json.listzonesresponse.zone;
|
||||
var items = [{
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
if (zoneObjs != null) {
|
||||
for (i = 0; i < zoneObjs.length; i++) {
|
||||
items.push({
|
||||
id: zoneObjs[i].id,
|
||||
description: zoneObjs[i].name
|
||||
});
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
|
|
@ -1758,7 +1795,13 @@
|
|||
snapshotid: args.context.snapshots[0].id,
|
||||
name: args.data.name
|
||||
};
|
||||
|
||||
|
||||
if (args.$form.find('.form-item[rel=zoneid]').css("display") != "none" && args.data.zoneid != '') {
|
||||
$.extend(data, {
|
||||
zoneId: args.data.zoneid
|
||||
});
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL('createVolume'),
|
||||
data: data,
|
||||
|
|
|
|||
Loading…
Reference in New Issue