diff options
| author | Michael Wood <michael.g.wood@intel.com> | 2015-12-07 18:43:15 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-10 13:29:18 +0000 |
| commit | 8b1d0438bc1dd6aeea37fb039897f8c3e023f5ce (patch) | |
| tree | 76838708ffac0d0b066aea907337f0eb6c686aab /bitbake/lib/toaster/toastergui/static | |
| parent | 32048fa71f596c31cfc3b9c75ed0af098e711ff4 (diff) | |
| download | poky-8b1d0438bc1dd6aeea37fb039897f8c3e023f5ce.tar.gz | |
bitbake: toaster: libtoaster Add createCustomRecipe method
This adds the function to call the ReSt API to create a custom image
recipe.
(Bitbake rev: 03e7949f538733f682a05d0c318cf2f4cd64cbf5)
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')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index 1012034404..e81f567057 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js | |||
| @@ -332,6 +332,32 @@ var libtoaster = (function (){ | |||
| 332 | $("#change-notification, #change-notification *").fadeIn(); | 332 | $("#change-notification, #change-notification *").fadeIn(); |
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | function _createCustomRecipe(name, baseRecipeId, doneCb){ | ||
| 336 | var data = { | ||
| 337 | 'name' : name, | ||
| 338 | 'project' : libtoaster.ctx.projectId, | ||
| 339 | 'base' : baseRecipeId, | ||
| 340 | }; | ||
| 341 | |||
| 342 | $.ajax({ | ||
| 343 | type: "POST", | ||
| 344 | url: libtoaster.ctx.xhrCustomRecipeUrl, | ||
| 345 | data: data, | ||
| 346 | headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, | ||
| 347 | success: function (ret) { | ||
| 348 | if (doneCb){ | ||
| 349 | doneCb(ret); | ||
| 350 | } else if (ret.error !== "ok") { | ||
| 351 | console.warn(ret.error); | ||
| 352 | } | ||
| 353 | }, | ||
| 354 | error: function (ret) { | ||
| 355 | console.warn("Call failed"); | ||
| 356 | console.warn(ret); | ||
| 357 | } | ||
| 358 | }); | ||
| 359 | } | ||
| 360 | |||
| 335 | 361 | ||
| 336 | return { | 362 | return { |
| 337 | reload_params : reload_params, | 363 | reload_params : reload_params, |
| @@ -347,6 +373,7 @@ var libtoaster = (function (){ | |||
| 347 | addRmLayer : _addRmLayer, | 373 | addRmLayer : _addRmLayer, |
| 348 | makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg, | 374 | makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg, |
| 349 | showChangeNotification : _showChangeNotification, | 375 | showChangeNotification : _showChangeNotification, |
| 376 | createCustomRecipe: _createCustomRecipe, | ||
| 350 | }; | 377 | }; |
| 351 | })(); | 378 | })(); |
| 352 | 379 | ||
