summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-09-26 13:59:36 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-30 16:52:22 +0100
commitac5aba6cab06f3a8655eea1e368d28eb1025407e (patch)
tree021d4a1d5c18ff1ae61b06a9a91f81724d955691 /bitbake/lib/toaster/toastergui/static
parent5b23bf083b7adcd7884d58aaf26f23102e6e3f5a (diff)
downloadpoky-ac5aba6cab06f3a8655eea1e368d28eb1025407e.tar.gz
bitbake: toaster: customrecipe Add frontend feature to delete custom image recipe
[YOCTO #8132] (Bitbake rev: 19aee3dd7fa290e12216f9a5cf25a8b2c8d80d20) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/customrecipe.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
index 505a81ce60..9ea9602881 100644
--- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
+++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
@@ -281,4 +281,36 @@ function customRecipePageInit(ctx) {
281 window.location.replace(libtoaster.ctx.projectBuildsUrl); 281 window.location.replace(libtoaster.ctx.projectBuildsUrl);
282 }); 282 });
283 }); 283 });
284
285 $("#delete-custom-recipe-confirmed").click(function(e){
286 e.preventDefault();
287 libtoaster.disableAjaxLoadingTimer();
288 $(this).find('[data-role="submit-state"]').hide();
289 $(this).find('[data-role="loading-state"]').show();
290 $(this).attr("disabled", "disabled");
291
292 $.ajax({
293 type: 'DELETE',
294 url: ctx.recipe.xhrCustomRecipeUrl,
295 headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
296 success: function (data) {
297 if (data.error !== "ok") {
298 console.warn(data.error);
299 } else {
300 var msg = $('<span>You have deleted <strong>1</strong> custom image: <strong id="deleted-custom-image-name"></strong></span>');
301 msg.find("#deleted-custom-image-name").text(ctx.recipe.name);
302
303 libtoaster.setNotification("custom-image-recipe-deleted",
304 msg.html());
305
306 window.location.replace(data.gotoUrl);
307 }
308 },
309 error: function (data) {
310 console.warn(data);
311 }
312 });
313 });
314
315
284} 316}