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

Add option for manufacturers and developers

This commit is contained in:
Mark Haslinghuis 2021-12-03 22:12:58 +01:00
parent 3562ed9d3a
commit 706a239044
No known key found for this signature in database
GPG key ID: 198B0F616296A584
4 changed files with 28 additions and 3 deletions

View file

@ -270,10 +270,13 @@ const serial = {
chrome.serial.getDevices(function (devices_array) {
const devices = [];
devices_array.forEach(function (device) {
const isFC = self.serialDevices.some(el => el.vendorId === device.vendorId) && self.serialDevices.some(el => el.productId === device.productId);
let showAllSerialDevices = false;
if (isFC) {
devices_array.forEach(function (device) {
ConfigStorage.get('showAllSerialDevices', res => showAllSerialDevices = res.showAllSerialDevices);
const isKnownSerialDevice = self.serialDevices.some(el => el.vendorId === device.vendorId) && self.serialDevices.some(el => el.productId === device.productId);
if (isKnownSerialDevice || showAllSerialDevices) {
devices.push({
path: device.path,
displayName: device.displayName,

View file

@ -15,6 +15,7 @@ options.initialize = function (callback) {
TABS.options.initAnalyticsOptOut();
TABS.options.initCliAutoComplete();
TABS.options.initAutoConnectConnectionTimeout();
TABS.options.initShowAllSerialDevices();
TABS.options.initCordovaForceComputerUI();
TABS.options.initDarkTheme();
@ -133,6 +134,17 @@ options.initAutoConnectConnectionTimeout = function () {
});
};
options.initShowAllSerialDevices = function() {
const showAllSerialDevicesElement = $('div.showAllSerialDevices input');
ConfigStorage.get('showAllSerialDevices', result => {
showAllSerialDevicesElement
.prop('checked', !!result.showAllSerialDevices)
.on('change', () => ConfigStorage.set({ showAllSerialDevices: showAllSerialDevicesElement.is(':checked') }))
.trigger('change');
});
};
options.initCordovaForceComputerUI = function () {
if (GUI.isCordova() && cordovaUI.canChangeUI) {
ConfigStorage.get('cordovaForceComputerUI', function (result) {