mirror of
https://git.yoctoproject.org/poky
synced 2026-02-09 02:03:04 +01:00
When a build is viewed in the dashboard, enable users to edit a custom image which was built during that build, and/or create a new custom image based on one of the image recipes built during the build. Add methods to the Build model to enable querying for the set of image recipes built during a build. Add buttons to the dashboard, with the "Edit custom image" button opening a basic modal for now. The "New custom image" button opens the existing new custom image modal, but is modified to show a list of images available as a base for a new custom image. Add a new function to the new custom image modal's script which enables multiple potential custom images to be shown as radio buttons in the dialog (if there is more than 1). Modify existing code to use this new function. Add a template filter which allows the queryset of recipes for a build to be available to client-side scripts, and from there be used to populate the new custom image modal. [YOCTO #9123] (Bitbake rev: 4c49ffd28e41c4597bdac34d5e54c125571a4b95) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
52 lines
1.3 KiB
JavaScript
52 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");
|
|
|
|
var recipe = {id: $(this).data('recipe'), name: null}
|
|
newCustomImageModalSetRecipes([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);
|
|
});
|
|
});
|
|
}
|