From 6f3d33c2931033dc5381cc67fe2c40a4c296fdca Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Fri, 9 Dec 2016 16:52:53 +0000 Subject: bitbake: toaster: Switch front end to use Layer get REST API Switch the front end to use the proper REST API for retrieving layer information. (Bitbake rev: 5ea25c49091f4d4b5007af948e063ed25ba5766f) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 6 +++++- bitbake/lib/toaster/toastergui/templates/layer_btn.html | 15 ++++++++++++--- .../lib/toaster/toastergui/templates/layerdetails.html | 1 + bitbake/lib/toaster/toastergui/templates/machine_btn.html | 7 ++++++- bitbake/lib/toaster/toastergui/templates/recipe_btn.html | 8 +++++++- 5 files changed, 31 insertions(+), 6 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index 86662b7a68..e7d6a950fc 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/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/bitbake/lib/toaster/toastergui/templates/layer_btn.html b/bitbake/lib/toaster/toastergui/templates/layer_btn.html index b2f73eba7a..1580991a16 100644 --- a/bitbake/lib/toaster/toastergui/templates/layer_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/layer_btn.html @@ -1,4 +1,9 @@ - - - diff --git a/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/bitbake/lib/toaster/toastergui/templates/layerdetails.html index f1569bd630..e0069db80c 100644 --- a/bitbake/lib/toaster/toastergui/templates/layerdetails.html +++ b/bitbake/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/bitbake/lib/toaster/toastergui/templates/machine_btn.html b/bitbake/lib/toaster/toastergui/templates/machine_btn.html index 5d93d7aa9d..12b5c96c2c 100644 --- a/bitbake/lib/toaster/toastergui/templates/machine_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/machine_btn.html @@ -4,7 +4,12 @@ {% endif %} > Select machine - -