Skip to content

Commit c1101eb

Browse files
author
Jessica Wang
committed
CLOUDSTACK-5606: UI > copy template, copy ISO action > when a template/ISO to be copied is not associated with a specific zone, UI does not pass sourcezoneid parameter to API.
1 parent db8d5f6 commit c1101eb

1 file changed

Lines changed: 28 additions & 10 deletions

File tree

ui/scripts/templates.js

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -795,11 +795,20 @@
795795
}
796796
}
797797
},
798-
action: function(args) {
799-
$.ajax({
800-
url: createURL("copyTemplate&id=" + args.context.templates[0].id + "&sourcezoneid=" + args.context.templates[0].zoneid + "&destzoneid=" + args.data.destinationZoneId),
801-
dataType: "json",
802-
async: true,
798+
action: function(args) {
799+
var data = {
800+
id: args.context.templates[0].id,
801+
destzoneid: args.data.destinationZoneId
802+
};
803+
if (args.context.templates[0].zoneid != undefined) {
804+
$.extend(data, {
805+
sourcezoneid: args.context.templates[0].zoneid
806+
});
807+
}
808+
809+
$.ajax({
810+
url: createURL('copyTemplate'),
811+
data: data,
803812
success: function(json) {
804813
var jid = json.copytemplateresponse.jobid;
805814
args.response.success({
@@ -1557,11 +1566,20 @@
15571566
}
15581567
}
15591568
},
1560-
action: function(args) {
1561-
$.ajax({
1562-
url: createURL("copyIso&id=" + args.context.isos[0].id + "&sourcezoneid=" + args.context.isos[0].zoneid + "&destzoneid=" + args.data.destinationZoneId),
1563-
dataType: "json",
1564-
async: true,
1569+
action: function(args) {
1570+
var data = {
1571+
id: args.context.isos[0].id,
1572+
destzoneid: args.data.destinationZoneId
1573+
};
1574+
if (args.context.isos[0].zoneid != undefined) {
1575+
$.extend(data, {
1576+
sourcezoneid: args.context.isos[0].zoneid
1577+
});
1578+
}
1579+
1580+
$.ajax({
1581+
url: createURL('copyIso'),
1582+
data: data,
15651583
success: function(json) {
15661584
var jid = json.copytemplateresponse.jobid;
15671585
args.response.success({

0 commit comments

Comments
 (0)