Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 16A50E009B8; Thu, 6 Aug 2015 03:16:17 -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.176 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 2A9DEE00867 for ; Thu, 6 Aug 2015 03:16:15 -0700 (PDT) Received: by wibhh20 with SMTP id hh20so17299277wib.0 for ; Thu, 06 Aug 2015 03:16:11 -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; bh=Jdvi/jmJL9htps5R4Mkg7ag/9DPyLLVwgVaeqGEntx4=; b=DC/pN2/0O+ssRilmIpSvUb21WLVg8h5aVwSabpubcXEmD+wASmTBrVNjcibiQapuaf wgIFICxlHataDBDfet4eDjRyI8jhahOCyHHeqqIokBC2xTfNxhj25iA+fZvtqCIpKkNS aAeDX71oU7FAhsZiRyjlqVTJwvj2GLpITjOqaShhppkj68aDpcn/SMDv4Vvai+1aWHKi 4R76NZTqmyqY/zYR1TKtQ+tS4TUDLzOm2ANbktcDkHqawuoBFBDQWbHGcsg07uP5QMNy swApXukKBmwzZu9t4Rg//Qbkw+BbASWgvGfi9Vs0bXytYUTP+avw+bvcxyt74Tb6ci3B AvdQ== X-Gm-Message-State: ALoCoQlr3juG/WmWbkzLitY0x1e/TvGT0ePR7oT546EzP3uHlbSm0LC5TKz3DPaCxWWY5Pa1vpRK X-Received: by 10.180.211.98 with SMTP id nb2mr4837778wic.91.1438856171657; Thu, 06 Aug 2015 03:16:11 -0700 (PDT) Received: from draco.icx.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id m4sm8659642wjb.37.2015.08.06.03.16.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Aug 2015 03:16:10 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 6 Aug 2015 11:15:57 +0100 Message-Id: <1438856157-7954-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [review-request][PATCH] 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 10:16:17 -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 be6bbcd..d38a26a 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 8d5166be..1d5f5ea 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 @@ -