From 0064747f301bc4b691c50c546853496a0786cb23 Mon Sep 17 00:00:00 2001 From: J Blackman Date: Sat, 19 Nov 2022 13:14:43 +1100 Subject: [PATCH] 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. --- locales/en/messages.json | 6 +++++ src/js/tabs/firmware_flasher.js | 39 +++++++++++++++++++++++---------- src/tabs/firmware_flasher.html | 13 +++++++++++ 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 9b6615ec..5ec33064 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -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." } } diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js index bef79c1e..8fefe70a 100644 --- a/src/js/tabs/firmware_flasher.js +++ b/src/js/tabs/firmware_flasher.js @@ -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(); diff --git a/src/tabs/firmware_flasher.html b/src/tabs/firmware_flasher.html index 6ff77d2a..ab98473b 100644 --- a/src/tabs/firmware_flasher.html +++ b/src/tabs/firmware_flasher.html @@ -150,6 +150,19 @@
+
+
+
+ +
+
+
+
+
+