Files
poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js
Michael Wood 0db62c54a4 bitbake: toaster: libtoaster Update implementation of startABuild and cancelABuild
Update the implementation of startABuild and cancelAbuild to reflect
changes to the backend api. We now have a dedicated endpoint to make
calls into so add this url to libtoaster.ctx and allow passing null in
as a url value to indicate that we want to use the current project

Also:
 - Fix some documentation comments
 - Add the convenience of passing in an array of targets to startABuild

(Bitbake rev: 61a21d96abab113cbd13376cdb8b08a426b50538)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00

51 lines
1.3 KiB
JavaScript

"use strict";
function recipeDetailsPageInit(ctx){
$(".customise-btn").click(function(e){
e.preventDefault();
var imgCustomModal = $("#new-custom-image-modal");
if (imgCustomModal.length === 0)
throw("Modal new-custom-image not found");
imgCustomModal.data('recipe', $(this).data('recipe'));
imgCustomModal.modal('show');
});
$("#add-layer-btn").click(function(){
var btn = $(this);
libtoaster.addRmLayer(ctx.recipe.layer_version,
true,
function (layersList){
var msg = libtoaster.makeLayerAddRmAlertMsg(ctx.recipe.layer_version,
layersList,
true);
libtoaster.showChangeNotification(msg);
var toShow = $("#customise-build-btns");
/* If we have no packages built yet also fade in the build packages
* hint message
*/
if (ctx.recipe.totalPackages === 0){
toShow = toShow.add("#build-to-get-packages-msg");
}
$("#packages-alert").add(btn).fadeOut(function(){
toShow.fadeIn();
});
});
});
/* Trigger a build of your custom image */
$(".build-recipe-btn").click(function(){
libtoaster.startABuild(null, ctx.recipe.name,
function(){
window.location.replace(libtoaster.ctx.projectBuildsUrl);
});
});
}