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:
parent
3562ed9d3a
commit
706a239044
4 changed files with 28 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue