1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

bitbake: toastergui: remove xhr_datatypeahead and xhr_XXXbuild

We remove the endpoints for XHR on the toastergui application.

The endpoints are now replaced with calls to the respective
REST endpoints (i.e. projectlayers, projecttargets, projectmachines).

(Bitbake rev: 8e7a2c3b125a34fd9d6fa0442ab13290137ecc51)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2015-06-08 13:36:56 +01:00
committed by Richard Purdie
parent 88dca45a70
commit a8be6d4bb1
16 changed files with 119 additions and 201 deletions
@@ -89,7 +89,7 @@ function basePageInit (ctx) {
if (!selectedTarget)
selectedTarget = { name: newBuildTargetInput.val() };
/* fire and forget */
libtoaster.startABuild(ctx.projectBuildUrl, libtoaster.ctx.projectId, selectedTarget.name, null, null);
libtoaster.startABuild(ctx.projectBuildsUrl, libtoaster.ctx.projectId, selectedTarget.name, null, null);
window.location.replace(libtoaster.ctx.projectPageUrl);
});
@@ -105,13 +105,13 @@ function basePageInit (ctx) {
libtoaster.ctx.projectName = selectedProject.name;
libtoaster.ctx.projectId = selectedProject.id;
ctx.projectBuildUrl = selectedProject.projectBuildUrl;
ctx.projectBuildsUrl = selectedProject.projectBuildsUrl;
/* we can create a target typeahead only after we have a project selected */
newBuildTargetInput.prop("disabled", false);
newBuildTargetBuildBtn.prop("disabled", false);
libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.xhrProjectDataTypeaheadUrl, { type : "targets" }, function(item){
libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function(item){
/* successfully selected a target */
selectedTarget = item;
});
@@ -18,7 +18,7 @@ function importLayerPageInit (ctx) {
$("#new-project-button").hide();
libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" }, function(item){
libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.projectLayersUrl, { include_added: "true" }, function(item){
currentLayerDepSelection = item;
layerDepBtn.removeAttr("disabled");
@@ -28,7 +28,7 @@ function importLayerPageInit (ctx) {
/* We automatically add "openembedded-core" layer for convenience as a
* dependency as pretty much all layers depend on this one
*/
$.getJSON(libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" , value: "openembedded-core" }, function(layer) {
$.getJSON(libtoaster.ctx.projectLayersUrl, { include_added: "true" , search: "openembedded-core" }, function(layer) {
if (layer.list.length == 1) {
currentLayerDepSelection = layer.list[0];
layerDepBtn.click();
@@ -211,7 +211,7 @@ function importLayerPageInit (ctx) {
var name = $(this).val();
/* Check if the layer name exists */
$.getJSON(libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" , value: name }, function(layer) {
$.getJSON(libtoaster.ctx.projectLayersUrl, { include_added: "true" , search: name }, function(layer) {
if (layer.list.length > 0) {
for (var i in layer.list){
if (layer.list[i].name == name) {
@@ -9,7 +9,7 @@ function layerDetailsPageInit (ctx) {
var addRmLayerBtn = $("#add-remove-layer-btn");
/* setup the dependencies typeahead */
libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" }, function(item){
libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.projectLayersUrl, { include_added: "true" }, function(item){
currentLayerDepSelection = item;
layerDepBtn.removeAttr("disabled");
@@ -170,7 +170,7 @@ function layerDetailsPageInit (ctx) {
$(".build-target-btn").click(function(){
/* fire a build */
var target = $(this).data('target-name');
libtoaster.startABuild(ctx.projectBuildUrl, libtoaster.ctx.projectId, target, null, null);
libtoaster.startABuild(ctx.projectBuildsUrl, libtoaster.ctx.projectId, target, null, null);
window.location.replace(libtoaster.ctx.projectPageUrl);
});
});
@@ -93,7 +93,7 @@ var libtoaster = (function (){
}
/* cancelABuild:
* url: xhr_projectbuild
* url: projectbuilds
* builds_ids: space separated list of build request ids
* onsuccess: callback for successful execution
* onfail: callback for failed execution
@@ -172,15 +172,15 @@ var libtoaster = (function (){
function _getLayerDepsForProject(projectId, layerId, onSuccess, onFail){
/* Check for dependencies not in the current project */
$.getJSON(libtoaster.ctx.xhrProjectDataTypeaheadUrl,
{ type: 'layerdeps', 'value': layerId , project_id: projectId },
$.getJSON(libtoaster.ctx.projectLayersUrl,
{ format: 'json', search: layerId },
function(data) {
if (data.error != "ok") {
console.log(data.error);
if (onFail !== undefined)
onFail(data);
} else {
onSuccess(data);
onSuccess(data.layerdeps);
}
}, function() {
console.log("E: Failed to make request");