diff --git a/bitbake/lib/toaster/contrib/tts/urllist.py b/bitbake/lib/toaster/contrib/tts/urllist.py index 433ac9fe85..0226334f0b 100644 --- a/bitbake/lib/toaster/contrib/tts/urllist.py +++ b/bitbake/lib/toaster/contrib/tts/urllist.py @@ -40,9 +40,7 @@ URLS = [ 'toastergui/project/1/importlayer', 'toastergui/project/1/targets/', 'toastergui/project/1/machines/', -'toastergui/xhr_projectbuild/1/', 'toastergui/xhr_configvaredit/1', -'toastergui/xhr_datatypeahead/1', 'toastergui/xhr_importlayer/', 'toastergui/xhr_updatelayer/', 'toastergui/project/1/buildrequest/1', diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js index 9c8d01ef5a..747442cc9e 100644 --- a/bitbake/lib/toaster/toastergui/static/js/base.js +++ b/bitbake/lib/toaster/toastergui/static/js/base.js @@ -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; }); diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index beb2ede3dc..e1fc5c5187 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js @@ -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) { diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index 8e14b8f277..ab781829cd 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js @@ -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); }); }); diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index 87910299a5..2a9a790693 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js @@ -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"); diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html index 5d51bc3c95..7fee26eb42 100644 --- a/bitbake/lib/toaster/toastergui/templates/base.html +++ b/bitbake/lib/toaster/toastergui/templates/base.html @@ -33,12 +33,10 @@ htmlUrl : "{% static 'html/' %}", projectsUrl : "{% url 'all-projects' %}", {% if project.id %} - xhrProjectDataTypeaheadUrl : "{% url 'xhr_datatypeahead' project.id %}", projectPageUrl : "{% url 'project' project.id %}", projectName : "{{project.name}}", projectId : {{project.id}}, {% else %} - xhrProjectDataTypeaheadUrl : undefined, projectPageUrl : undefined, projectName : undefined, projectId : undefined, diff --git a/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/bitbake/lib/toaster/toastergui/templates/layerdetails.html index c27d259a8c..ef1795c0e2 100644 --- a/bitbake/lib/toaster/toastergui/templates/layerdetails.html +++ b/bitbake/lib/toaster/toastergui/templates/layerdetails.html @@ -3,7 +3,7 @@ {% load humanize %} {% load static %} {% block localbreadcrumb %} -