mirror of https://github.com/apache/cloudstack.git
Fix createForm actions for template section
This commit is contained in:
parent
27a552278f
commit
650301fc94
|
|
@ -1,4 +1,4 @@
|
|||
(function(cloudStack, testData) {
|
||||
(function(cloudStack, $, testData) {
|
||||
|
||||
cloudStack.sections.templates = {
|
||||
title: 'Templates',
|
||||
|
|
@ -290,18 +290,13 @@
|
|||
|
||||
copyTemplate: {
|
||||
label: 'Copy template',
|
||||
addRow: 'false',
|
||||
messages: {
|
||||
confirm: function(args) {
|
||||
return 'Are you sure you want to copy template?';
|
||||
},
|
||||
success: function(args) {
|
||||
return 'Template is being copied.';
|
||||
},
|
||||
notification: function(args) {
|
||||
return 'Copying template';
|
||||
},
|
||||
complete: function(args) {
|
||||
return 'Template has been copied.';
|
||||
}
|
||||
},
|
||||
createForm: {
|
||||
|
|
@ -310,6 +305,7 @@
|
|||
fields: {
|
||||
destinationZoneId: {
|
||||
label: 'Destination zone',
|
||||
validation: { required: true },
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("listZones&available=true"),
|
||||
|
|
@ -317,12 +313,21 @@
|
|||
async: true,
|
||||
success: function(json) {
|
||||
args.response.success({
|
||||
data: $.map(json.listzonesresponse.zone, function(zone) {
|
||||
return {
|
||||
id: zone.id,
|
||||
description: zone.name
|
||||
};
|
||||
})
|
||||
data: $.map(
|
||||
$.grep(
|
||||
json.listzonesresponse.zone ? json.listzonesresponse.zone : [],
|
||||
|
||||
function(zone) {
|
||||
return zone.id != args.context.templates[0].zoneid;
|
||||
}
|
||||
),
|
||||
function(zone) {
|
||||
return {
|
||||
id: zone.id,
|
||||
description: zone.name
|
||||
};
|
||||
}
|
||||
)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -562,6 +567,7 @@
|
|||
fields: {
|
||||
destinationZoneId: {
|
||||
label: 'Destination zone',
|
||||
validation: { required: true },
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("listZones&available=true"),
|
||||
|
|
@ -1005,19 +1011,14 @@
|
|||
confirm: function(args) {
|
||||
return 'Are you sure you want to copy ISO?';
|
||||
},
|
||||
success: function(args) {
|
||||
return 'ISO is being copied.';
|
||||
},
|
||||
notification: function(args) {
|
||||
return 'Copying ISO';
|
||||
},
|
||||
complete: function(args) {
|
||||
return 'ISO has been copied.';
|
||||
}
|
||||
},
|
||||
createForm: {
|
||||
title: 'Copy ISO',
|
||||
desc: '',
|
||||
addRow: 'false',
|
||||
fields: {
|
||||
destinationZoneId: {
|
||||
label: 'Destination zone',
|
||||
|
|
@ -1629,4 +1630,4 @@
|
|||
return allowedActions;
|
||||
}
|
||||
|
||||
})(cloudStack, testData);
|
||||
})(cloudStack, jQuery, testData);
|
||||
|
|
|
|||
Loading…
Reference in New Issue