1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Adding custom define input box (#3074)

This commit is contained in:
J Blackman 2022-11-09 10:11:07 +11:00 committed by GitHub
parent b0a2c40c22
commit 2a01685373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 1 deletions

View file

@ -6740,5 +6740,11 @@
},
"firmwareFlasherBranchDescription": {
"message": "Especially useful for developers, you can select a merged PR, specify a commit sha, or specify a 'yet to be merged' PR by typing in: pull/{PR number}/head ."
},
"firmwareFlasherCustomDefinesDescription": {
"message": "For developers, you can add any defines you need, separated by a `space`, but without the `USE_` prefix, it will be added automatically for you."
},
"firmwareFlasherBuildCustomDefines": {
"message": "Custom Defines"
}
}

View file

@ -324,9 +324,17 @@ button {
}
}
}
select {
input {
background-color: #3a3a3a;
color: white;
border: solid 1px var(--subtleAccent);
border-radius: 3px;
min-height: 20px;
padding: 2px;
}
select {
background-color: #424242;
color: white;
}
}
.options {

View file

@ -807,6 +807,9 @@ firmware_flasher.initialize = function (callback) {
if (summary.releaseType === "Unstable") {
request.commit = $('select[name="commits"] option:selected').val();
$('input[name="customDefines"]').val().split(' ').map(element => element.trim()).forEach(v => {
request.options.push(v);
});
}
self.releaseLoader.requestBuild(request, (info) => {

View file

@ -200,6 +200,13 @@
<div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherBranchDescription"></div>
</div>
</div>
<div style="width: 49%; float: right;">
<strong i18n="firmwareFlasherBuildCustomDefines"></strong>
<div id="customDefinesInfo">
<input id="customDefines" name="customDefines" style="width: 95%"></input>
<div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherCustomDefinesDescription"></div>
</div>
</div>
</div>
</div>
</div>