bitbake: toaster: toastergui: implement machine name validation
Valid machine names cannot include spaces anywhere in the name and doing so will result in a build failure. This implements a mechanism to alert the user against such a misconfiguration and does not allow input of such machine names. [YOCTO #8721] (Bitbake rev: 6fb642935a3787659aa316ca906025d2d87964cf) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
eb7430e5b9
commit
f45a5a5de8
|
@ -12,6 +12,8 @@ function projectPageInit(ctx) {
|
||||||
var machineChangeFormToggle = $("#change-machine-toggle");
|
var machineChangeFormToggle = $("#change-machine-toggle");
|
||||||
var machineNameTitle = $("#project-machine-name");
|
var machineNameTitle = $("#project-machine-name");
|
||||||
var machineChangeCancel = $("#cancel-machine-change");
|
var machineChangeCancel = $("#cancel-machine-change");
|
||||||
|
var machineInputForm = $("#machine-input-form");
|
||||||
|
var invalidMachineNameHelp = $("#invalid-machine-name-help");
|
||||||
|
|
||||||
var freqBuildBtn = $("#freq-build-btn");
|
var freqBuildBtn = $("#freq-build-btn");
|
||||||
var freqBuildList = $("#freq-build-list");
|
var freqBuildList = $("#freq-build-list");
|
||||||
|
@ -208,8 +210,23 @@ function projectPageInit(ctx) {
|
||||||
|
|
||||||
|
|
||||||
/* Change machine functionality */
|
/* Change machine functionality */
|
||||||
|
machineChangeInput.keyup(function(){
|
||||||
|
if ($(this).val().indexOf(' ') >= 0) {
|
||||||
|
machineChangeBtn.attr("disabled", "disabled");
|
||||||
|
invalidMachineNameHelp.show();
|
||||||
|
machineInputForm.addClass('has-error');
|
||||||
|
} else {
|
||||||
|
machineChangeBtn.removeAttr("disabled");
|
||||||
|
invalidMachineNameHelp.hide();
|
||||||
|
machineInputForm.removeClass('has-error');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
machineChangeFormToggle.click(function(){
|
machineChangeFormToggle.click(function(){
|
||||||
|
machineChangeInput.val(machineNameTitle.text());
|
||||||
|
machineChangeBtn.removeAttr("disabled");
|
||||||
|
invalidMachineNameHelp.hide();
|
||||||
|
machineInputForm.removeClass('has-error');
|
||||||
machineForm.slideDown();
|
machineForm.slideDown();
|
||||||
machineNameTitle.hide();
|
machineNameTitle.hide();
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
|
|
|
@ -67,11 +67,12 @@
|
||||||
|
|
||||||
<form id="select-machine-form" style="display:none;" class="form-inline">
|
<form id="select-machine-form" style="display:none;" class="form-inline">
|
||||||
<span class="help-block">Machine suggestions come from the list of layers added to your project. If you don't see the machine you are looking for, <a href="{% url 'projectmachines' project.id %}">check the full list of machines</a></span>
|
<span class="help-block">Machine suggestions come from the list of layers added to your project. If you don't see the machine you are looking for, <a href="{% url 'projectmachines' project.id %}">check the full list of machines</a></span>
|
||||||
<div class="form-group">
|
<div class="form-group" id="machine-input-form">
|
||||||
<input class="form-control" id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text">
|
<input class="form-control" id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text">
|
||||||
</div>
|
</div>
|
||||||
<button id="machine-change-btn" class="btn btn-default" type="button">Save</button>
|
<button id="machine-change-btn" class="btn btn-default" type="button">Save</button>
|
||||||
<a href="#" id="cancel-machine-change" class="btn btn-link">Cancel</a>
|
<a href="#" id="cancel-machine-change" class="btn btn-link">Cancel</a>
|
||||||
|
<span class="help-block text-danger" id="invalid-machine-name-help" style="display:none">A valid machine name cannot include spaces.</span>
|
||||||
<p class="form-link"><a href="{% url 'projectmachines' project.id %}">View compatible machines</a></p>
|
<p class="form-link"><a href="{% url 'projectmachines' project.id %}">View compatible machines</a></p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue