From: Michael Wood Date: Fri, 9 Dec 2016 16:52:53 +0000 (+0000) Subject: toaster: Switch front end to use Layer get REST API X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ea25c49091f4d4b5007af948e063ed25ba5766f;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toaster: Switch front end to use Layer get REST API Switch the front end to use the proper REST API for retrieving layer information. Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- diff --git a/lib/toaster/toastergui/static/js/libtoaster.js b/lib/toaster/toastergui/static/js/libtoaster.js index 86662b7a685..e7d6a950fc7 100644 --- a/lib/toaster/toastergui/static/js/libtoaster.js +++ b/lib/toaster/toastergui/static/js/libtoaster.js @@ -274,9 +274,13 @@ var libtoaster = (function () { } function _addRmLayer(layerObj, add, doneCb){ + if (layerObj.xhrLayerUrl === undefined){ + throw("xhrLayerUrl is undefined") + } + if (add === true) { /* If adding get the deps for this layer */ - libtoaster.getLayerDepsForProject(layerObj.layerdetailurl, + libtoaster.getLayerDepsForProject(layerObj.xhrLayerUrl, function (layers) { /* got result for dependencies */ diff --git a/lib/toaster/toastergui/templates/layer_btn.html b/lib/toaster/toastergui/templates/layer_btn.html index b2f73eba7a8..1580991a163 100644 --- a/lib/toaster/toastergui/templates/layer_btn.html +++ b/lib/toaster/toastergui/templates/layer_btn.html @@ -1,4 +1,9 @@ - - - diff --git a/lib/toaster/toastergui/templates/layerdetails.html b/lib/toaster/toastergui/templates/layerdetails.html index f1569bd6302..e0069db80c5 100644 --- a/lib/toaster/toastergui/templates/layerdetails.html +++ b/lib/toaster/toastergui/templates/layerdetails.html @@ -71,6 +71,7 @@ inCurrentPrj : false, {% endif %} layerdetailurl : "{% url 'layerdetails' project.id layerversion.id %}", + xhrLayerUrl: "{% url 'xhr_layer' project.id layerversion.id %}", layer_source: {{layerversion.layer_source|json}}, }, layerSourceTypes: {{layer_source|json}}, diff --git a/lib/toaster/toastergui/templates/machine_btn.html b/lib/toaster/toastergui/templates/machine_btn.html index 5d93d7aa9d2..12b5c96c2cc 100644 --- a/lib/toaster/toastergui/templates/machine_btn.html +++ b/lib/toaster/toastergui/templates/machine_btn.html @@ -4,7 +4,12 @@ {% endif %} > Select machine - -