diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-07-31 15:09:05 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-01 11:26:11 +0100 |
commit | dd8c78b07af068c84d0658950ad459e38342981e (patch) | |
tree | d4ff3f7789c1f6e48c6d4cfadbee403f4bec9408 /bitbake/lib/toaster/toastergui/static/js/importlayer.js | |
parent | d826d4e800245d7a0df61a145b8688e9e7a2e32f (diff) | |
download | openembedded-core-contrib-dd8c78b07af068c84d0658950ad459e38342981e.tar.gz |
bitbake: toastergui: importlayer Add format type to JSON calls
After API was changed we now need to pass the parameter "format=json" as
a get parameter when requesting a json payload. Otherwise we get the
html version of the page instead of the data we need.
(Bitbake rev: 4545c21b70998bd240c3a21de05e8d4642044119)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/importlayer.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/importlayer.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index e9d7ae8ef2..df48e84876 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js @@ -28,9 +28,11 @@ 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.projectLayersUrl, { include_added: "true" , search: "openembedded-core" }, function(layer) { - if (layer.list.length == 1) { - currentLayerDepSelection = layer.list[0]; + $.getJSON(libtoaster.ctx.projectLayersUrl, + { include_added: "true" , search: "openembedded-core", format: "json" }, + function(layer) { + if (layer.rows.length > 0) { + currentLayerDepSelection = layer.rows[0]; layerDepBtn.click(); } }); @@ -211,16 +213,18 @@ function importLayerPageInit (ctx) { var name = $(this).val(); /* Check if the layer name exists */ - $.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) { - console.log(layer.list[i]) - layerExistsError(layer.list[i]); + $.getJSON(libtoaster.ctx.projectLayersUrl, + { include_added: "true" , search: name, format: "json" }, + function(layer) { + if (layer.list.length > 0) { + for (var i in layer.list){ + if (layer.list[i].name == name) { + console.log(layer.list[i]) + layerExistsError(layer.list[i]); + } + } } - } - } - }); + }); }); vcsURLInput.on('input', function() { |