mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
32048fa71f
commit
8b1d0438bc
@@ -332,6 +332,32 @@ var libtoaster = (function (){
|
|||||||
$("#change-notification, #change-notification *").fadeIn();
|
$("#change-notification, #change-notification *").fadeIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _createCustomRecipe(name, baseRecipeId, doneCb){
|
||||||
|
var data = {
|
||||||
|
'name' : name,
|
||||||
|
'project' : libtoaster.ctx.projectId,
|
||||||
|
'base' : baseRecipeId,
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: libtoaster.ctx.xhrCustomRecipeUrl,
|
||||||
|
data: data,
|
||||||
|
headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
|
||||||
|
success: function (ret) {
|
||||||
|
if (doneCb){
|
||||||
|
doneCb(ret);
|
||||||
|
} else if (ret.error !== "ok") {
|
||||||
|
console.warn(ret.error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (ret) {
|
||||||
|
console.warn("Call failed");
|
||||||
|
console.warn(ret);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
reload_params : reload_params,
|
reload_params : reload_params,
|
||||||
@@ -347,6 +373,7 @@ var libtoaster = (function (){
|
|||||||
addRmLayer : _addRmLayer,
|
addRmLayer : _addRmLayer,
|
||||||
makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg,
|
makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg,
|
||||||
showChangeNotification : _showChangeNotification,
|
showChangeNotification : _showChangeNotification,
|
||||||
|
createCustomRecipe: _createCustomRecipe,
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}},
|
machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}},
|
||||||
|
|
||||||
projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}},
|
projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}},
|
||||||
|
xhrCustomRecipeUrl : "{% url 'xhr_customrecipe' %}",
|
||||||
projectId : {{project.id}},
|
projectId : {{project.id}},
|
||||||
{% else %}
|
{% else %}
|
||||||
projectId : undefined,
|
projectId : undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user