summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,