summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-10-16 10:18:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-16 14:13:23 +0100
commit5effe8f63252ee4d28b985a956378690ff37c01c (patch)
treeddea330253d9f6eb320b604181ff3e87da39eb13 /bitbake/lib
parent320d05ea9fd353879e5e77ed97a21d76dd510210 (diff)
downloadpoky-5effe8f63252ee4d28b985a956378690ff37c01c.tar.gz
bitbake: toaster: Allow any text input to machine configuration variable
Allow any text input to the machine variable; as we may not have discovered all the available machines until after a build. [YOCTO #8418] (Bitbake rev: f44b34833f164daf34c57703429ed8f122888037) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectpage.js20
1 files 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 b0fe4510a9..e742ef291a 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) {
23 var cancelReleaseChange = $("#cancel-release-change"); 23 var cancelReleaseChange = $("#cancel-release-change");
24 24
25 var currentLayerAddSelection; 25 var currentLayerAddSelection;
26 var currentMachineAddSelection = {}; 26 var currentMachineAddSelection = "";
27 27
28 var urlParams = libtoaster.parseUrlParams(); 28 var urlParams = libtoaster.parseUrlParams();
29 29
@@ -38,7 +38,7 @@ function projectPageInit(ctx) {
38 */ 38 */
39 if (urlParams.hasOwnProperty('setMachine') && 39 if (urlParams.hasOwnProperty('setMachine') &&
40 urlParams.setMachine !== prjInfo.machine.name){ 40 urlParams.setMachine !== prjInfo.machine.name){
41 currentMachineAddSelection.name = urlParams.setMachine; 41 machineChangeInput.val(urlParams.setMachine);
42 machineChangeBtn.click(); 42 machineChangeBtn.click();
43 } else { 43 } else {
44 updateMachineName(prjInfo.machine.name); 44 updateMachineName(prjInfo.machine.name);
@@ -254,29 +254,33 @@ function projectPageInit(ctx) {
254 } 254 }
255 255
256 libtoaster.makeTypeahead(machineChangeInput, libtoaster.ctx.machinesTypeAheadUrl, { }, function(item){ 256 libtoaster.makeTypeahead(machineChangeInput, libtoaster.ctx.machinesTypeAheadUrl, { }, function(item){
257 currentMachineAddSelection = item; 257 currentMachineAddSelection = item.name;
258 machineChangeBtn.removeAttr("disabled"); 258 machineChangeBtn.removeAttr("disabled");
259 }); 259 });
260 260
261 machineChangeBtn.click(function(e){ 261 machineChangeBtn.click(function(e){
262 e.preventDefault(); 262 e.preventDefault();
263 if (currentMachineAddSelection.name === undefined) 263 /* We accept any value regardless of typeahead selection or not */
264 if (machineChangeInput.val().length === 0)
264 return; 265 return;
265 266
266 libtoaster.editCurrentProject({ machineName : currentMachineAddSelection.name }, 267 currentMachineAddSelection = machineChangeInput.val();
268
269 libtoaster.editCurrentProject(
270 { machineName : currentMachineAddSelection },
267 function(){ 271 function(){
268 /* Success machine changed */ 272 /* Success machine changed */
269 updateMachineName(currentMachineAddSelection.name); 273 updateMachineName(currentMachineAddSelection);
270 machineChangeCancel.click(); 274 machineChangeCancel.click();
271 275
272 /* Show the alert message */ 276 /* Show the alert message */
273 var message = $('<span class="lead">You have changed the machine to: <strong><span id="notify-machine-name"></span></strong></span>'); 277 var message = $('<span class="lead">You have changed the machine to: <strong><span id="notify-machine-name"></span></strong></span>');
274 message.find("#notify-machine-name").text(currentMachineAddSelection.name); 278 message.find("#notify-machine-name").text(currentMachineAddSelection);
275 libtoaster.showChangeNotification(message); 279 libtoaster.showChangeNotification(message);
276 }, 280 },
277 function(){ 281 function(){
278 /* Failed machine changed */ 282 /* Failed machine changed */
279 console.log("failed to change machine"); 283 console.warn("Failed to change machine");
280 }); 284 });
281 }); 285 });
282 286