Skip to content

Commit cfd2ce7

Browse files
committed
CLOUDSTACK-9172 Added cross zones check to delete template and iso
1 parent e3e5be8 commit cfd2ce7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ui/scripts/templates.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,8 +1451,12 @@
14511451
}
14521452
},
14531453
action: function(args) {
1454+
var queryParams = "deleteTemplate&id=" + args.context.templates[0].id;
1455+
if (!args.context.templates[0].crossZones){
1456+
queryParams += "&zoneid=" + args.context.zones[0].zoneid;
1457+
}
14541458
$.ajax({
1455-
url: createURL("deleteTemplate&id=" + args.context.templates[0].id + "&zoneid=" + args.context.zones[0].zoneid),
1459+
url: createURL(queryParams),
14561460
dataType: "json",
14571461
async: true,
14581462
success: function(json) {
@@ -2536,12 +2540,12 @@
25362540
}
25372541
},
25382542
action: function(args) {
2539-
var array1 = [];
2540-
if (args.context.zones[0].zoneid != null)
2541-
array1.push("&zoneid=" + args.context.zones[0].zoneid);
2542-
2543+
var queryParams = "deleteIso&id=" + args.context.isos[0].id;
2544+
if (!args.context.isos[0].crossZones){
2545+
queryParams += "&zoneid=" + args.context.zones[0].zoneid;
2546+
}
25432547
$.ajax({
2544-
url: createURL("deleteIso&id=" + args.context.isos[0].id + "&zoneid=" + args.context.zones[0].zoneid),
2548+
url: createURL(queryParams),
25452549
dataType: "json",
25462550
async: true,
25472551
success: function(json) {

0 commit comments

Comments
 (0)