summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-12-07 18:43:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:18 +0000
commit8b1d0438bc1dd6aeea37fb039897f8c3e023f5ce (patch)
tree76838708ffac0d0b066aea907337f0eb6c686aab /bitbake
parent32048fa71f596c31cfc3b9c75ed0af098e711ff4 (diff)
downloadpoky-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')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js27
-rw-r--r--bitbake/lib/toaster/toastergui/templates/base.html1
2 files changed, 28 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
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html
index e56bb34e38..6994bcc9ad 100644
--- a/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/bitbake/lib/toaster/toastergui/templates/base.html
@@ -45,6 +45,7 @@
45 machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}}, 45 machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}},
46 46
47 projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}}, 47 projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}},
48 xhrCustomRecipeUrl : "{% url 'xhr_customrecipe' %}",
48 projectId : {{project.id}}, 49 projectId : {{project.id}},
49 {% else %} 50 {% else %}
50 projectId : undefined, 51 projectId : undefined,