[gnome-continuous-yocto/gnomeostree-3.28-rocko: 3653/8267] bitbake: toaster: Switch front end to use Layer get REST API
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 3653/8267] bitbake: toaster: Switch front end to use Layer get REST API
- Date: Sun, 17 Dec 2017 00:56:08 +0000 (UTC)
commit 6f3d33c2931033dc5381cc67fe2c40a4c296fdca
Author: Michael Wood <michael g wood intel com>
Date: Fri Dec 9 16:52:53 2016 +0000
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 <michael g wood intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
.../lib/toaster/toastergui/static/js/libtoaster.js | 6 +++++-
.../toaster/toastergui/templates/layer_btn.html | 15 ++++++++++++---
.../toaster/toastergui/templates/layerdetails.html | 1 +
.../toaster/toastergui/templates/machine_btn.html | 7 ++++++-
.../toaster/toastergui/templates/recipe_btn.html | 8 +++++++-
5 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index 86662b7..e7d6a95 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 b2f73eb..1580991 100644
--- a/bitbake/lib/toaster/toastergui/templates/layer_btn.html
+++ b/bitbake/lib/toaster/toastergui/templates/layer_btn.html
@@ -1,4 +1,9 @@
-<a class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}},
"name": "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}'
data-directive="remove"
+<a class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn" data-layer='{
+ "id": {{data.pk}},
+ "name": "{{data.layer.name}}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+ "layerdetailurl": "{% url 'layerdetails' extra.pid data.pk %}"
+ }' data-directive="remove"
{% if data.pk not in extra.current_layers %}
style="display:none;"
{% endif %}
@@ -6,7 +11,12 @@
<span class="glyphicon glyphicon-trash"></span>
Remove layer
</a>
-<a class="btn btn-default btn-block layer-add-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}}, "name":
"{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="add"
+<a class="btn btn-default btn-block layer-add-{{data.pk}} layerbtn"
+ data-layer='{ "id": {{data.pk}},
+ "name": "{{data.layer.name}}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+ "layerdetailurl": "{%url "layerdetails" extra.pid data.pk %}"
+ }' data-directive="add"
{% if data.pk in extra.current_layers %}
style="display:none;"
{% endif %}
@@ -14,4 +24,3 @@
<span class="glyphicon glyphicon-plus"></span>
Add layer
</a>
-
diff --git a/bitbake/lib/toaster/toastergui/templates/layerdetails.html
b/bitbake/lib/toaster/toastergui/templates/layerdetails.html
index f1569bd..e0069db 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 5d93d7a..12b5c96 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</a>
-<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.id}}" data-layer='{ "id":
{{data.layer_version.id}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url
'layerdetails' extra.pid data.layer_version.id %}"}' data-directive="add"
+<a class="btn btn-default btn-block layerbtn
+layer-add-{{data.layer_version.id}}" data-layer='{ "id":
+ {{data.layer_version.id}}, "name": "{{data.layer_version.layer.name}}",
+ "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.id %},
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+ }' data-directive="add"
{% if data.layer_version.pk in extra.current_layers %}
style="display:none;"
{% endif %}
diff --git a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
index e372964..0ee0ba5 100644
--- a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
+++ b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
@@ -5,7 +5,13 @@
>
Build recipe
</a>
-<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.pk}}" data-layer='{ "id":
{{data.layer_version.pk}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url
'layerdetails' extra.pid data.layer_version.pk%}"}' data-directive="add"
+<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.pk}}"
+ data-layer='{
+ "id": {{data.layer_version.pk}},
+ "name": "{{data.layer_version.layer.name}}",
+ "layerdetailurl": "{%url "layerdetails" extra.pid data.layer_version.pk%}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.layer_version.pk %}"
+ }' data-directive="add"
{% if data.layer_version.pk in extra.current_layers %}
style="display:none;"
{% endif %}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]