1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 01:05:15 +03:00

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.
This commit is contained in:
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": { "firmwareFlasherBuildCustomDefines": {
"message": "Custom Defines" "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.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 // bind UI hook so the status is saved on change
$('input.flash_manual_baud').change(function() { $('input.flash_manual_baud').change(function() {
const status = $(this).is(':checked'); const status = $(this).is(':checked');
@ -778,23 +789,27 @@ firmware_flasher.initialize = function (callback) {
telemetryProtocols: [], telemetryProtocols: [],
motorProtocols: [], motorProtocols: [],
options: [], options: [],
classicBuild: false,
}; };
$('select[name="radioProtocols"] option:selected').each(function () { request.classicBuild = $('input[name="classicBuildModeCheckbox"]').is(':checked');
request.radioProtocols.push($(this).val()); if (!request.classicBuild) {
}); $('select[name="radioProtocols"] option:selected').each(function () {
request.radioProtocols.push($(this).val());
});
$('select[name="telemetryProtocols"] option:selected').each(function () { $('select[name="telemetryProtocols"] option:selected').each(function () {
request.telemetryProtocols.push($(this).val()); request.telemetryProtocols.push($(this).val());
}); });
$('select[name="options"] option:selected').each(function () { $('select[name="options"] option:selected').each(function () {
request.options.push($(this).val()); request.options.push($(this).val());
}); });
$('select[name="motorProtocols"] option:selected').each(function () { $('select[name="motorProtocols"] option:selected').each(function () {
request.motorProtocols.push($(this).val()); request.motorProtocols.push($(this).val());
}); });
}
if (summary.releaseType === "Unstable") { if (summary.releaseType === "Unstable") {
request.commit = $('select[name="commits"] option:selected').val(); 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 class="spacer_box_title" style="text-align: center;" i18n="firmwareFlasherBuildConfigurationHead">
</div> </div>
</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="spacer" style="margin-bottom: 10px;">
<div class="margin-bottom"> <div class="margin-bottom">
<div style="width: 49%; float: left;"> <div style="width: 49%; float: left;">