Adding ability to specify a classic build (#3087)

* Adding ability to specify a classic build

This means a user rather than using cloud options, can simply get all options (same as previous unified nightlies).

* Corrected means to enable/disable.
10.9-maintenance
J Blackman 2022-11-19 13:14:43 +11:00 committed by GitHub
parent 6b78f369fd
commit 0064747f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 12 deletions

View File

@ -6776,5 +6776,11 @@
},
"firmwareFlasherBuildCustomDefines": {
"message": "Custom Defines"
},
"classicBuild": {
"message": "Classic Mode"
},
"classicBuildModeDescription": {
"message": "This mode ignores all the parameters here, except for the commit. This essentially achieves the same as the classic nightlies, and is provided for convenience."
}
}

View File

@ -647,6 +647,17 @@ firmware_flasher.initialize = function (callback) {
$('input.flash_manual_baud').prop('checked', false);
}
$('input.classicbuild_mode').change(function () {
const status = $(this).is(':checked');
$('select[name="radioProtocols"]').attr('disabled', status);
$('select[name="telemetryProtocols"]').attr('disabled', status);
$('select[name="motorProtocols"]').attr('disabled', status);
$('select[name="options"]').attr('disabled', status);
$('input[name="customDefines"]').attr('disabled', status);
});
$('input.classicbuild_mode').change();
// bind UI hook so the status is saved on change
$('input.flash_manual_baud').change(function() {
const status = $(this).is(':checked');
@ -778,23 +789,27 @@ firmware_flasher.initialize = function (callback) {
telemetryProtocols: [],
motorProtocols: [],
options: [],
classicBuild: false,
};
$('select[name="radioProtocols"] option:selected').each(function () {
request.radioProtocols.push($(this).val());
});
request.classicBuild = $('input[name="classicBuildModeCheckbox"]').is(':checked');
if (!request.classicBuild) {
$('select[name="radioProtocols"] option:selected').each(function () {
request.radioProtocols.push($(this).val());
});
$('select[name="telemetryProtocols"] option:selected').each(function () {
request.telemetryProtocols.push($(this).val());
});
$('select[name="telemetryProtocols"] option:selected').each(function () {
request.telemetryProtocols.push($(this).val());
});
$('select[name="options"] option:selected').each(function () {
request.options.push($(this).val());
});
$('select[name="options"] option:selected').each(function () {
request.options.push($(this).val());
});
$('select[name="motorProtocols"] option:selected').each(function () {
request.motorProtocols.push($(this).val());
});
$('select[name="motorProtocols"] option:selected').each(function () {
request.motorProtocols.push($(this).val());
});
}
if (summary.releaseType === "Unstable") {
request.commit = $('select[name="commits"] option:selected').val();

View File

@ -150,6 +150,19 @@
<div class="spacer_box_title" style="text-align: center;" i18n="firmwareFlasherBuildConfigurationHead">
</div>
</div>
<div class="spacer" style="margin-bottom: 10px;">
<div class="margin-bottom">
<div style="width: 49%; float: left;">
<label>
<input class="classicbuild_mode toggle" type="checkbox" name="classicBuildModeCheckbox" />
<span i18n="classicBuild"></span>
</label>
<div class="helpicon cf_tip_wide" i18n_title="classicBuildModeDescription"></div>
</div>
<div style="width: 49%; float: right;">
</div>
</div>
</div>
<div class="spacer" style="margin-bottom: 10px;">
<div class="margin-bottom">
<div style="width: 49%; float: left;">