Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B2186E00B9D; Tue, 8 Dec 2015 13:17:56 -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=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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.220.48 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-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 6A50BE00B9D for ; Tue, 8 Dec 2015 13:17:38 -0800 (PST) Received: by pacwq6 with SMTP id wq6so17740816pac.1 for ; Tue, 08 Dec 2015 13:17:38 -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=vSVTGU3AU3NXFLY9GLopM/wr+ziPGUDTo+jGH78dwRk=; b=EoFAs0c7Nk8AtkFP1H8ljpjb8DnNEkuqn8c8r0hnE5+yBlIFxs6zDKfKGo0lkfE4G/ JRII8PrJ4GOD0PnxzDM9EseTERDru3YiMmW2p/8jrTPTA0oVosH0DoJrpNVXy0eSR9Ky SYhi4gXe4pSB4MEcCNZ+2edS0dOyi4SF7UpReacbEfRMaVJ+woqkjMLNYjRIxPJizZB0 5asM1Ih/AprojveBTZfY1wNtAI+QPpZRQ/FVnrvu2SFdpGbYLp+L6mMkGfI93KIiefvx 0Whv15O6RxeUz8tKrXNlyfzeMPf6z1x0pIA++KDNooBRANxRrzioLeZfNAr8+krvHBC5 b8uA== 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=vSVTGU3AU3NXFLY9GLopM/wr+ziPGUDTo+jGH78dwRk=; b=fX+3wGITGoSFncvZEDg/QTROD3+MyfHwtVc18q2U+PXwRaKCV70xPu/YelOAicu4Nd 5N0Lo20kyfyPlx++mRREWqwMpx9RSfxC42VdI/Ww+j0DGjUHadPIVqFppV9rw1en9Op3 hSSNMEVhiIOjDQ7sF8l9xlcubDmPTTedEGuHCLC42XjU2Yk1QQd/GsWqn/BXHVDXvgBf a7WWWSB7+Wjq0dcFnEoyIR1qJjVlTGsOoR5iM0QQ/s6QCy2jiJ+I1PvVzTNMonviU2ja 96EQtU8H1RvPw4MmQstkf7Afc4MWJrZvc7d3TzgMkVK/92koepKIMYCl0V0eTCFm7LLR w5Zw== X-Gm-Message-State: ALoCoQlhtcNjxQTJs3SrSNft8es+Wx1TpFHInxWVxQA6IZZsDG2MU0HvqyUEDuV9AqO+XW2eS7hU/+3PNraFvpqXEv/I41rL9A== X-Received: by 10.66.142.232 with SMTP id rz8mr3034341pab.74.1449609458782; Tue, 08 Dec 2015 13:17:38 -0800 (PST) Received: from draco.ger.corp.intel.com ([192.55.54.40]) by smtp.gmail.com with ESMTPSA id v64sm6675766pfi.50.2015.12.08.13.17.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 13:17:37 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 8 Dec 2015 21:16:10 +0000 Message-Id: <1449609380-11073-25-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449609380-11073-1-git-send-email-michael.g.wood@intel.com> References: <1449609380-11073-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 24/34] toaster: libtoaster Add createCustomRecipe method 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: Tue, 08 Dec 2015 21:17:56 -0000 This adds the function to call the ReSt API to create a custom image recipe. Signed-off-by: Michael Wood --- .../lib/toaster/toastergui/static/js/libtoaster.js | 27 ++++++++++++++++++++++ bitbake/lib/toaster/toastergui/templates/base.html | 1 + 2 files changed, 28 insertions(+) diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index c04f7ab..d7f0394 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js @@ -332,6 +332,32 @@ var libtoaster = (function (){ $("#change-notification, #change-notification *").fadeIn(); } + function _createCustomRecipe(name, baseRecipeId, doneCb){ + var data = { + 'name' : name, + 'project' : libtoaster.ctx.projectId, + 'base' : baseRecipeId, + }; + + $.ajax({ + type: "POST", + url: libtoaster.ctx.xhrCustomRecipeUrl, + data: data, + headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, + success: function (ret) { + if (doneCb){ + doneCb(ret); + } else if (ret.error !== "ok") { + console.warn(ret.error); + } + }, + error: function (ret) { + console.warn("Call failed"); + console.warn(ret); + } + }); + } + return { reload_params : reload_params, @@ -347,6 +373,7 @@ var libtoaster = (function (){ addRmLayer : _addRmLayer, makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg, showChangeNotification : _showChangeNotification, + createCustomRecipe: _createCustomRecipe, }; })(); diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html index e56bb34..6994bcc 100644 --- a/bitbake/lib/toaster/toastergui/templates/base.html +++ b/bitbake/lib/toaster/toastergui/templates/base.html @@ -45,6 +45,7 @@ machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}}, projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}}, + xhrCustomRecipeUrl : "{% url 'xhr_customrecipe' %}", projectId : {{project.id}}, {% else %} projectId : undefined, -- 2.1.4