Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id BBD59E00BFE; Wed, 7 Oct 2015 02:27:02 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.115 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 24CD1E0049B for ; Wed, 7 Oct 2015 02:26:58 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 07 Oct 2015 02:26:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,648,1437462000"; d="scan'208";a="821168135" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga002.jf.intel.com with ESMTP; 07 Oct 2015 02:25:32 -0700 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.164]) by IRSMSX104.ger.corp.intel.com ([169.254.5.46]) with mapi id 14.03.0248.002; Wed, 7 Oct 2015 10:25:06 +0100 From: "Barros Pena, Belen" To: "Wood, Michael G" , "toaster@yoctoproject.org" Thread-Topic: [Toaster] [PATCH] toaster: Allow any text input to machine configuration variable Thread-Index: AQHRAOIN7yfUi7/tSUu0LcXfGRr0iA== Date: Wed, 7 Oct 2015 09:25:06 +0000 Message-ID: References: <1444152373-22100-1-git-send-email-michael.g.wood@intel.com> In-Reply-To: <1444152373-22100-1-git-send-email-michael.g.wood@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.5.5.150821 x-originating-ip: [10.252.7.47] MIME-Version: 1.0 Subject: Re: [PATCH] toaster: Allow any text input to machine configuration variable 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: Wed, 07 Oct 2015 09:27:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-ID: <057D423D32B8924AA3CFF32F5CD7F531@intel.com> Content-Transfer-Encoding: quoted-printable On 06/10/2015 18:26, "toaster-bounces@yoctoproject.org on behalf of Michael Wood" wrote: >Allow any text input to the machine variable; as we may not have >discovered >all the available machines until after a build. > >[YOCTO #8418] This works for me. I can now set any crazy string I want as my machine (and also set machines for local projects). Thanks! Bel=E9n > >Signed-off-by: Michael Wood >--- > .../lib/toaster/toastergui/static/js/projectpage.js | 20 >++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) > >diff --git a/bitbake/lib/toaster/toastergui/static/js/projectpage.js >b/bitbake/lib/toaster/toastergui/static/js/projectpage.js >index d367047..95cef18 100644 >--- a/bitbake/lib/toaster/toastergui/static/js/projectpage.js >+++ b/bitbake/lib/toaster/toastergui/static/js/projectpage.js >@@ -23,7 +23,7 @@ function projectPageInit(ctx) { > var cancelReleaseChange =3D $("#cancel-release-change"); >=20 > var currentLayerAddSelection; >- var currentMachineAddSelection =3D {}; >+ var currentMachineAddSelection =3D ""; >=20 > var urlParams =3D libtoaster.parseUrlParams(); >=20 >@@ -38,7 +38,7 @@ function projectPageInit(ctx) { > */ > if (urlParams.hasOwnProperty('setMachine') && > urlParams.setMachine !=3D=3D prjInfo.machine.name){ >- currentMachineAddSelection.name =3D urlParams.setMachine; >+ machineChangeInput.val(urlParams.setMachine); > machineChangeBtn.click(); > } else { > updateMachineName(prjInfo.machine.name); >@@ -251,29 +251,33 @@ function projectPageInit(ctx) { > } >=20 > libtoaster.makeTypeahead(machineChangeInput, >libtoaster.ctx.machinesTypeAheadUrl, { }, function(item){ >- currentMachineAddSelection =3D item; >+ currentMachineAddSelection =3D item.name; > machineChangeBtn.removeAttr("disabled"); > }); >=20 > machineChangeBtn.click(function(e){ > e.preventDefault(); >- if (currentMachineAddSelection.name =3D=3D=3D undefined) >+ /* We accept any value regardless of typeahead selection or not */ >+ if (machineChangeInput.val().length =3D=3D=3D 0) > return; >=20 >- libtoaster.editCurrentProject({ machineName : >currentMachineAddSelection.name }, >+ currentMachineAddSelection =3D machineChangeInput.val(); >+ >+ libtoaster.editCurrentProject( >+ { machineName : currentMachineAddSelection }, > function(){ > /* Success machine changed */ >- updateMachineName(currentMachineAddSelection.name); >+ updateMachineName(currentMachineAddSelection); > machineChangeCancel.click(); >=20 > /* Show the alert message */ > var message =3D $('You have changed the mach= ine >to: '); >- =20 >message.find("#notify-machine-name").text(currentMachineAddSelection.name) >; >+ =20 >message.find("#notify-machine-name").text(currentMachineAddSelection); > libtoaster.showChangeNotification(message); > }, > function(){ > /* Failed machine changed */ >- console.log("failed to change machine"); >+ console.warn("Failed to change machine"); > }); > }); >=20 >--=20 >2.1.4 > >--=20 >_______________________________________________ >toaster mailing list >toaster@yoctoproject.org >https://lists.yoctoproject.org/listinfo/toaster