diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-11-04 15:46:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-10 13:29:17 +0000 |
commit | ce7289613bc24e0f3b17dd79ab4e8aa52edc70ce (patch) | |
tree | 0b80c37aa571710215167198fe5828445748e6e2 /bitbake/lib/toaster/toastergui/static/js | |
parent | 5f52614a878269fe7837b7198e653377b25b91d8 (diff) | |
download | poky-ce7289613bc24e0f3b17dd79ab4e8aa52edc70ce.tar.gz |
bitbake: toaster: Add recipe details page
This page provides the details of recipes, showing their packages and
additional metadata. It also allows you to build the recipe or customise
the recipe if it is an image recipe.
[YOCTO #8070]
(Bitbake rev: b6023619397f679791b7eff1faac06f4246133ce)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/recipedetails.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/recipedetails.js b/bitbake/lib/toaster/toastergui/static/js/recipedetails.js new file mode 100644 index 0000000000..2bfd0a4b2c --- /dev/null +++ b/bitbake/lib/toaster/toastergui/static/js/recipedetails.js | |||
@@ -0,0 +1,52 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | function recipeDetailsPageInit(ctx){ | ||
4 | |||
5 | $(".customise-btn").click(function(e){ | ||
6 | e.preventDefault(); | ||
7 | var imgCustomModal = $("#new-custom-image-modal"); | ||
8 | |||
9 | if (imgCustomModal.length === 0) | ||
10 | throw("Modal new-custom-image not found"); | ||
11 | |||
12 | imgCustomModal.data('recipe', $(this).data('recipe')); | ||
13 | imgCustomModal.modal('show'); | ||
14 | }); | ||
15 | |||
16 | $("#add-layer-btn").click(function(){ | ||
17 | var btn = $(this); | ||
18 | |||
19 | libtoaster.addRmLayer(ctx.recipe.layer_version, | ||
20 | true, | ||
21 | function (layersList){ | ||
22 | var msg = libtoaster.makeLayerAddRmAlertMsg(ctx.recipe.layer_version, | ||
23 | layersList, | ||
24 | true); | ||
25 | |||
26 | libtoaster.showChangeNotification(msg); | ||
27 | |||
28 | var toShow = $("#customise-build-btns"); | ||
29 | |||
30 | /* If we have no packages built yet also fade in the build packages | ||
31 | * hint message | ||
32 | */ | ||
33 | if (ctx.recipe.totalPackages === 0){ | ||
34 | toShow = toShow.add("#build-to-get-packages-msg"); | ||
35 | } | ||
36 | |||
37 | $("#packages-alert").add(btn).fadeOut(function(){ | ||
38 | toShow.fadeIn(); | ||
39 | }); | ||
40 | }); | ||
41 | }); | ||
42 | |||
43 | /* Trigger a build of your custom image */ | ||
44 | $(".build-recipe-btn").click(function(){ | ||
45 | libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, | ||
46 | libtoaster.ctx.projectId, | ||
47 | ctx.recipe.name, | ||
48 | function(){ | ||
49 | window.location.replace(libtoaster.ctx.projectBuildsUrl); | ||
50 | }); | ||
51 | }); | ||
52 | } | ||