Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id BE7D3E00EB8; Tue, 6 Oct 2015 10:26:22 -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.172 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id E2F68E009B8 for ; Tue, 6 Oct 2015 10:26:18 -0700 (PDT) Received: by wicfx3 with SMTP id fx3so177233668wic.1 for ; Tue, 06 Oct 2015 10:26:18 -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=OwAxV+2fiYc8BEpuGwFjDe4RxA6gOBKrAPvhwswk/Ic=; b=lNHle1jsdbV/zeFnQm64xs3e6XKfn366oakn93Onu9akXM3HwgO1v2fBsOFYZbCA+S okJ6VwOaLBKMtHLTk0DdY+tYWbW5SEjiF5CXDkHpu7l248yec6hMpI/aZX2n+1kgBPqD 34KY4WCt9QzFPPsTFrB/rJ3chOV1olMXvi489B9vOyTdfnNgUuxG/lWCGCT0lAcFCEWV tVRkPN+RK5nHkpLjgXvuNciNRK0MS8lg28kvtL5J9gq2rVTxlp8sUp5YKDF8uit7jdpm WWWOJRxTVnwkApYNdZtu9ewr/w0u07n/Q+2QmN4rpxqPruvh2eWg1qYh6wnfL6UdN+j2 8F9A== X-Gm-Message-State: ALoCoQmcVogFYu+GW89/P5bCmJLX+x4mtucGAWOXIgEye4hgpQ2XUtCFaZO4CzocoJCgG5iu7E94 X-Received: by 10.180.184.134 with SMTP id eu6mr20052445wic.77.1444152377997; Tue, 06 Oct 2015 10:26:17 -0700 (PDT) Received: from localhost.localdomain ([2.218.205.118]) by smtp.gmail.com with ESMTPSA id gl8sm2608168wib.0.2015.10.06.10.26.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Oct 2015 10:26:17 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 6 Oct 2015 18:26:13 +0100 Message-Id: <1444152373-22100-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [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: Tue, 06 Oct 2015 17:26:22 -0000 Allow any text input to the machine variable; as we may not have discovered all the available machines until after a build. [YOCTO #8418] 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 = $("#cancel-release-change"); var currentLayerAddSelection; - var currentMachineAddSelection = {}; + var currentMachineAddSelection = ""; var urlParams = libtoaster.parseUrlParams(); @@ -38,7 +38,7 @@ function projectPageInit(ctx) { */ if (urlParams.hasOwnProperty('setMachine') && urlParams.setMachine !== prjInfo.machine.name){ - currentMachineAddSelection.name = urlParams.setMachine; + machineChangeInput.val(urlParams.setMachine); machineChangeBtn.click(); } else { updateMachineName(prjInfo.machine.name); @@ -251,29 +251,33 @@ function projectPageInit(ctx) { } libtoaster.makeTypeahead(machineChangeInput, libtoaster.ctx.machinesTypeAheadUrl, { }, function(item){ - currentMachineAddSelection = item; + currentMachineAddSelection = item.name; machineChangeBtn.removeAttr("disabled"); }); machineChangeBtn.click(function(e){ e.preventDefault(); - if (currentMachineAddSelection.name === undefined) + /* We accept any value regardless of typeahead selection or not */ + if (machineChangeInput.val().length === 0) return; - libtoaster.editCurrentProject({ machineName : currentMachineAddSelection.name }, + currentMachineAddSelection = machineChangeInput.val(); + + libtoaster.editCurrentProject( + { machineName : currentMachineAddSelection }, function(){ /* Success machine changed */ - updateMachineName(currentMachineAddSelection.name); + updateMachineName(currentMachineAddSelection); machineChangeCancel.click(); /* Show the alert message */ var message = $('You have changed the machine to: '); - message.find("#notify-machine-name").text(currentMachineAddSelection.name); + 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"); }); }); -- 2.1.4