Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 7BCA6E00953; Thu, 8 Dec 2016 10:43:04 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [74.125.82.50 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 8A901E00848 for ; Thu, 8 Dec 2016 10:42:59 -0800 (PST) Received: by mail-wm0-f50.google.com with SMTP id t79so39627286wmt.0 for ; Thu, 08 Dec 2016 10:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lxSNibUic5LYGOWkfR6yeWzGioxj2wYPDoFN6bjU4qc=; b=msI4L/HcHhhXcOEsOpQrQRciqczoYj59aWNvRJM4y+b9t4lMkFQO2AMcDs4/Mz6F24 uOm9tkOBg7yyCa8THzqe18WdC4rAsxJr9Af/+GHa+1eo1l5Lm/+ujY02VSJPnWz6rdQz r13kV+G0S8VPnhrYoDbkhTNTFYhIydJN4DuKsFKYmg6Ta1CPd0Z2LjHH/l01hA6f85C1 VTkwHNnx4ERm972arOtgdPaumyi9fWoQ9E7MLXuSilvvYtOitMe1yzboQcSQCUPgn2jY /dKcrlhpyMWxLEJ/cmtgwySm5xPJhx8cfwvzGX0hEdhAdDjPLdoMV+KhI86Xa0MfockP xWUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lxSNibUic5LYGOWkfR6yeWzGioxj2wYPDoFN6bjU4qc=; b=DfmN0+LFXHRV+DrlwvkwkRbk8GWr0MYQv8lTMiMukG94zSH1Sc4zXn5FUkybtGVfw8 Q6YG8pkxTxHITwiot2DCUcSSQ1WfY92ZGvpGnGlTZM1JPx6CPhN6yOWeQuSZw0jUSq9J AYmchIvfYpI+S7dabxz/YUI0vejGhf5progX12Us+lv3i17sILSU6hMUdunikUS8K6/m erntkjoAfzjej/0cYjiS37AdO6ifkIINek36MdlaTfDhs64q8r18hii4fxZtG6palwS7 pPihD3or8Hyk+pA5jsRGsRgJBWVxrSuFjimVAwOzbMuUxo9sLw/ty2jtxIvHqAprDUCe 0Hgg== X-Gm-Message-State: AKaTC00S5U38LFa0gH+yJcsX6b4Yof4utdnSXKOaYeO/9tjx53uyWOT+7xSlCkDC/1swPXtN X-Received: by 10.28.133.143 with SMTP id h137mr3391578wmd.58.1481222579139; Thu, 08 Dec 2016 10:42:59 -0800 (PST) Received: from localhost.localdomain ([192.198.151.62]) by smtp.gmail.com with ESMTPSA id d64sm16637008wmh.3.2016.12.08.10.42.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Dec 2016 10:42:58 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 8 Dec 2016 18:42:49 +0000 Message-Id: <1481222571-17651-4-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481222571-17651-1-git-send-email-michael.g.wood@intel.com> References: <1481222571-17651-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 3/5] toaster: Switch front end to use Layer get REST API X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 18:43:04 -0000 Switch the front end to use the proper REST API for retrieving layer information. Signed-off-by: Michael Wood --- 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(-) 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 @@ - - - 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 - -