1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

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>
This commit is contained in:
Michael Wood
2016-09-26 13:59:36 +03:00
committed by Richard Purdie
parent 5b23bf083b
commit ac5aba6cab
2 changed files with 63 additions and 4 deletions
@@ -281,4 +281,36 @@ function customRecipePageInit(ctx) {
window.location.replace(libtoaster.ctx.projectBuildsUrl);
});
});
$("#delete-custom-recipe-confirmed").click(function(e){
e.preventDefault();
libtoaster.disableAjaxLoadingTimer();
$(this).find('[data-role="submit-state"]').hide();
$(this).find('[data-role="loading-state"]').show();
$(this).attr("disabled", "disabled");
$.ajax({
type: 'DELETE',
url: ctx.recipe.xhrCustomRecipeUrl,
headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
success: function (data) {
if (data.error !== "ok") {
console.warn(data.error);
} else {
var msg = $('<span>You have deleted <strong>1</strong> custom image: <strong id="deleted-custom-image-name"></strong></span>');
msg.find("#deleted-custom-image-name").text(ctx.recipe.name);
libtoaster.setNotification("custom-image-recipe-deleted",
msg.html());
window.location.replace(data.gotoUrl);
}
},
error: function (data) {
console.warn(data);
}
});
});
}