summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-08 13:36:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-12 00:01:49 +0100
commita8be6d4bb18232f13ffcaaf1a4137322db59fe48 (patch)
treea5faf6af828e1ea571bf862f9c35c3d69e481d4e /bitbake/lib/toaster/toastergui/static
parent88dca45a703867581084d15368b7c68117b3184c (diff)
downloadpoky-a8be6d4bb18232f13ffcaaf1a4137322db59fe48.tar.gz
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>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/base.js6
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/importlayer.js6
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/layerdetails.js4
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js8
4 files changed, 12 insertions, 12 deletions
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) {
89 if (!selectedTarget) 89 if (!selectedTarget)
90 selectedTarget = { name: newBuildTargetInput.val() }; 90 selectedTarget = { name: newBuildTargetInput.val() };
91 /* fire and forget */ 91 /* fire and forget */
92 libtoaster.startABuild(ctx.projectBuildUrl, libtoaster.ctx.projectId, selectedTarget.name, null, null); 92 libtoaster.startABuild(ctx.projectBuildsUrl, libtoaster.ctx.projectId, selectedTarget.name, null, null);
93 window.location.replace(libtoaster.ctx.projectPageUrl); 93 window.location.replace(libtoaster.ctx.projectPageUrl);
94 }); 94 });
95 95
@@ -105,13 +105,13 @@ function basePageInit (ctx) {
105 libtoaster.ctx.projectName = selectedProject.name; 105 libtoaster.ctx.projectName = selectedProject.name;
106 libtoaster.ctx.projectId = selectedProject.id; 106 libtoaster.ctx.projectId = selectedProject.id;
107 107
108 ctx.projectBuildUrl = selectedProject.projectBuildUrl; 108 ctx.projectBuildsUrl = selectedProject.projectBuildsUrl;
109 109
110 /* we can create a target typeahead only after we have a project selected */ 110 /* we can create a target typeahead only after we have a project selected */
111 newBuildTargetInput.prop("disabled", false); 111 newBuildTargetInput.prop("disabled", false);
112 newBuildTargetBuildBtn.prop("disabled", false); 112 newBuildTargetBuildBtn.prop("disabled", false);
113 113
114 libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.xhrProjectDataTypeaheadUrl, { type : "targets" }, function(item){ 114 libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function(item){
115 /* successfully selected a target */ 115 /* successfully selected a target */
116 selectedTarget = item; 116 selectedTarget = item;
117 }); 117 });
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) {
18 18
19 $("#new-project-button").hide(); 19 $("#new-project-button").hide();
20 20
21 libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" }, function(item){ 21 libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.projectLayersUrl, { include_added: "true" }, function(item){
22 currentLayerDepSelection = item; 22 currentLayerDepSelection = item;
23 23
24 layerDepBtn.removeAttr("disabled"); 24 layerDepBtn.removeAttr("disabled");
@@ -28,7 +28,7 @@ function importLayerPageInit (ctx) {
28 /* We automatically add "openembedded-core" layer for convenience as a 28 /* We automatically add "openembedded-core" layer for convenience as a
29 * dependency as pretty much all layers depend on this one 29 * dependency as pretty much all layers depend on this one
30 */ 30 */
31 $.getJSON(libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" , value: "openembedded-core" }, function(layer) { 31 $.getJSON(libtoaster.ctx.projectLayersUrl, { include_added: "true" , search: "openembedded-core" }, function(layer) {
32 if (layer.list.length == 1) { 32 if (layer.list.length == 1) {
33 currentLayerDepSelection = layer.list[0]; 33 currentLayerDepSelection = layer.list[0];
34 layerDepBtn.click(); 34 layerDepBtn.click();
@@ -211,7 +211,7 @@ function importLayerPageInit (ctx) {
211 var name = $(this).val(); 211 var name = $(this).val();
212 212
213 /* Check if the layer name exists */ 213 /* Check if the layer name exists */
214 $.getJSON(libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" , value: name }, function(layer) { 214 $.getJSON(libtoaster.ctx.projectLayersUrl, { include_added: "true" , search: name }, function(layer) {
215 if (layer.list.length > 0) { 215 if (layer.list.length > 0) {
216 for (var i in layer.list){ 216 for (var i in layer.list){
217 if (layer.list[i].name == name) { 217 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) {
9 var addRmLayerBtn = $("#add-remove-layer-btn"); 9 var addRmLayerBtn = $("#add-remove-layer-btn");
10 10
11 /* setup the dependencies typeahead */ 11 /* setup the dependencies typeahead */
12 libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.xhrProjectDataTypeaheadUrl, { type : "layers", project_id: libtoaster.ctx.projectId, include_added: "true" }, function(item){ 12 libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.projectLayersUrl, { include_added: "true" }, function(item){
13 currentLayerDepSelection = item; 13 currentLayerDepSelection = item;
14 14
15 layerDepBtn.removeAttr("disabled"); 15 layerDepBtn.removeAttr("disabled");
@@ -170,7 +170,7 @@ function layerDetailsPageInit (ctx) {
170 $(".build-target-btn").click(function(){ 170 $(".build-target-btn").click(function(){
171 /* fire a build */ 171 /* fire a build */
172 var target = $(this).data('target-name'); 172 var target = $(this).data('target-name');
173 libtoaster.startABuild(ctx.projectBuildUrl, libtoaster.ctx.projectId, target, null, null); 173 libtoaster.startABuild(ctx.projectBuildsUrl, libtoaster.ctx.projectId, target, null, null);
174 window.location.replace(libtoaster.ctx.projectPageUrl); 174 window.location.replace(libtoaster.ctx.projectPageUrl);
175 }); 175 });
176 }); 176 });
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 (){
93 } 93 }
94 94
95 /* cancelABuild: 95 /* cancelABuild:
96 * url: xhr_projectbuild 96 * url: projectbuilds
97 * builds_ids: space separated list of build request ids 97 * builds_ids: space separated list of build request ids
98 * onsuccess: callback for successful execution 98 * onsuccess: callback for successful execution
99 * onfail: callback for failed execution 99 * onfail: callback for failed execution
@@ -172,15 +172,15 @@ var libtoaster = (function (){
172 172
173 function _getLayerDepsForProject(projectId, layerId, onSuccess, onFail){ 173 function _getLayerDepsForProject(projectId, layerId, onSuccess, onFail){
174 /* Check for dependencies not in the current project */ 174 /* Check for dependencies not in the current project */
175 $.getJSON(libtoaster.ctx.xhrProjectDataTypeaheadUrl, 175 $.getJSON(libtoaster.ctx.projectLayersUrl,
176 { type: 'layerdeps', 'value': layerId , project_id: projectId }, 176 { format: 'json', search: layerId },
177 function(data) { 177 function(data) {
178 if (data.error != "ok") { 178 if (data.error != "ok") {
179 console.log(data.error); 179 console.log(data.error);
180 if (onFail !== undefined) 180 if (onFail !== undefined)
181 onFail(data); 181 onFail(data);
182 } else { 182 } else {
183 onSuccess(data); 183 onSuccess(data.layerdeps);
184 } 184 }
185 }, function() { 185 }, function() {
186 console.log("E: Failed to make request"); 186 console.log("E: Failed to make request");