toaster: Allow any text input to machine configuration variable
PATCH 1/1 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]
--- .../lib/toaster/toastergui/static/js/projectpage.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
bitbake/lib/toaster/toastergui/static/js/projectpage.js +12 -8
@@ -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 = $('<span class="lead">You have changed the machine to: <strong><span id="notify-machine-name"></span></strong></span>'); - 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"); }); });
Signature · 1 line
2.1.4
Quoted 5 lines · On 06/10/2015 18:26, "[email protected] on behalf of Michael…
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én
Quoted 84 lines
Signed-off-by Michael Wood <[email protected]>---
.../lib/toaster/toastergui/static/js/projectpage.js | 20
++++++++++++--------1 file changed, 12 insertions(+), 8 deletions(-)bitbake/lib/toaster/toastergui/static/js/projectpage.js +11
-7@@ -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 = $('<span class="lead">You have changed the machine to: <strong><span id="notify-machine-name"></span></strong></span>'); - message.find("#notify-machine-name").text(currentMachineAddSelection.name) ; + message.find("#notify-machine-name").text(currentMachineAddSelection); libtoaster.showChangeNotification(message); },function(){ /* Failed machine changed */bitbake/lib/toaster/toastergui/static/js/projectpage.js +1
-1- console.log("failed to change machine"); + console.warn("Failed to change machine"); }); });Signature · 8 lines
-- 2.1.4 -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
Quoted 8 lines · Belen
Quoted 3 lines · On 06/10/2015 18:26, "[email protected] on behalf of Michael…
Allow any text input to the machine variable; as we may not have discovered
all the available machines until after a build.
Upstreamed and added to toaster-next.
Elliot
Quoted 101 lines
Quoted 2 lines
[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én
Quoted 79 lines
Signed-off-by Michael Wood <[email protected]>---
.../lib/toaster/toastergui/static/js/projectpage.js | 20
++++++++++++--------1 file changed, 12 insertions(+), 8 deletions(-)bitbake/lib/toaster/toastergui/static/js/projectpage.js +11
-7@@ -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 = $('<span class="lead">You have changed the machine to: <strong><span id="notify-machine-name"></span></strong></span>'); - message.find("#notify-machine-name").text(currentMachineAddSelection.name) ; + message.find("#notify-machine-name").text(currentMachineAddSelection); libtoaster.showChangeNotification(message); },function(){ /* Failed machine changed */bitbake/lib/toaster/toastergui/static/js/projectpage.js +1
-2- console.log("failed to change machine"); + console.warn("Failed to change machine"); }); }); --2.1.4
Quoted 5 lines
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre