Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id D4E85E00A49; Thu, 6 Aug 2015 07:16:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.174 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 9125EE009FD for ; Thu, 6 Aug 2015 07:16:58 -0700 (PDT) Received: by wicne3 with SMTP id ne3so24597627wic.1 for ; Thu, 06 Aug 2015 07:16:57 -0700 (PDT) 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=X48aOQr/Plo052BVixFQA2U6Cjjbd7SM0I3RSv2zu7c=; b=faLqF0ILw+ChEs7e1waoJ73Yc4c1zLO/piBBHmEQh1O15uaxOYvi8KNXrsEwL9iPlL +YXPfneGRTUEJ3l8BaFU1L6uPG4eC+6BYbuswk02vSvkx2xNQ3n791vs7U9fZBknigax Uin3Pk2h4uvTUl0+GI3M1/rJl1x5LWJcCwX6FPgE6e2Z/de7ihSmcPiF/yBq+/md4sHu cYRMleEgFgyrZhMOM4nbT1TREpFNps4M2wVXACXmFWphCKsdKMnR0Jp41qnt6MHc51Le M9s2sPTNIMPW1UiCVqqpBf7kaKDIKh6nyUNnBPs4V70UfYDJ1gdl69NBuTNE+ES86q9D ozoA== X-Gm-Message-State: ALoCoQn7HJot7sx3w5rFppwAfTxT0GnxoK8SuRhO1QpwcMirXptE2vVo6KB86ZYg9WPqXzYTV0sf X-Received: by 10.180.75.78 with SMTP id a14mr7146674wiw.68.1438870617630; Thu, 06 Aug 2015 07:16:57 -0700 (PDT) Received: from draco.icx.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id l13sm9751068wjr.18.2015.08.06.07.16.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Aug 2015 07:16:57 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 6 Aug 2015 15:16:26 +0100 Message-Id: <1438870586-17099-4-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438870586-17099-1-git-send-email-michael.g.wood@intel.com> References: <1438870586-17099-1-git-send-email-michael.g.wood@intel.com> Subject: [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism 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, 06 Aug 2015 14:16:59 -0000 The new project page is no longer responsible for triggering the build so add a handler for this in layerBtn which is used in the layerdetails and layers pages. This also removes the conflicting and redundant handler for this in the layerdetails. Signed-off-by: Michael Wood --- bitbake/lib/toaster/toastergui/static/js/layerBtn.js | 13 +++++++++++++ bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 8 -------- bitbake/lib/toaster/toastergui/tables.py | 2 +- bitbake/lib/toaster/toastergui/templates/recipe_btn.html | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/layerBtn.js b/bitbake/lib/toaster/toastergui/static/js/layerBtn.js index 4243c2b..a0509f9 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerBtn.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerBtn.js @@ -55,6 +55,19 @@ function layerBtnsInit(ctx) { }); }); + $(".build-recipe-btn").unbind('click'); + $(".build-recipe-btn").click(function(e){ + e.preventDefault(); + var recipe = $(this).data('recipe-name'); + + libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, + libtoaster.ctx.projectId, recipe, + function(){ + /* Success */ + window.location.replace(libtoaster.ctx.projectBuildsUrl); + }); + }); + /* Setup the initial state of the buttons */ for (var i in ctx.projectLayers){ diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index d12d3ae..3f5d7a9 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js @@ -179,14 +179,6 @@ function layerDetailsPageInit (ctx) { /* re run the machinesTabShow to update the text */ targetsTabShow(); } - - $(".build-target-btn").unbind('click'); - $(".build-target-btn").click(function(){ - /* fire a build */ - var target = $(this).data('target-name'); - libtoaster.startABuild(ctx.projectBuildsUrl, libtoaster.ctx.projectId, target, null, null); - window.location.replace(libtoaster.ctx.projectPageUrl); - }); }); $("#machinestable").on('table-done', function(e, total, tableParams){ diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 51fe4b6..810e101 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -465,7 +465,7 @@ class LayerRecipesTable(RecipesTable): field_name="get_description_or_summary") - build_recipe_template ='' + build_recipe_template ='' self.add_column(title="Build recipe", static_data_name="add-del-layers", diff --git a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html index d9ec3fa..77c1b23 100644 --- a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html @@ -1,6 +1,6 @@ -