@@ -15,8 +15,8 @@ const auxiliary = {};
1515
1616// BF build Options mapped to build Key
1717let buildMap = [
18- { buildKey : 'xxx' , buildOption : [ 'USE_ARCO_TRAINER' , 'USE_DASHBOARD' , 'USE_PINIO' ] } ,
1918 { buildKey : 'cam' , buildOption : [ 'USE_CAMERA_CONTROL' ] } ,
19+ { buildKey : 'div' , buildOption : [ 'USE_ARCO_TRAINER' , 'USE_DASHBOARD' , 'USE_PINIO' ] } ,
2020 { buildKey : 'dshot' , buildOption : [ 'USE_DSHOT' ] } ,
2121 { buildKey : 'gps' , buildOption : [ 'USE_GPS' , 'USE_GPS_PLUS_CODES' ] } ,
2222 { buildKey : 'led_strip' , buildOption : [ 'USE_LED_STRIP' , 'USE_LED_STRIP_64' ] } ,
@@ -48,9 +48,6 @@ let categoryTable = [
4848 { name : 'VTX' , buildKey : [ 'vtx' ] , modes : [ 'STICK COMMANDS DISABLE' , 'VTX CONTROL DISABLE' , 'VTX PIT MODE' ] } ,
4949] ;
5050
51-
52- const categoryFieldsSelect = $ ( '.auxiliary_category' ) ;
53-
5451function createTable ( data ) {
5552 // Create a dynamic table with fixed values
5653 let table = [ ] ;
@@ -107,18 +104,30 @@ The simulateMouseoverAndSelectForEachOption function iterates over each option i
107104You can also add a delay between each iteration if needed (commented out in the code). Adjust the delay according to your requirements.
108105*/
109106
110- function createCategorySelect ( table ) {
111- for ( let i = 0 ; i < table . length ; i ++ ) {
112- const str = `<option value="${ table [ i ] . name } ">${ table [ i ] . name } </option>` ;
113- $ ( '#auxiliary_filter_category .select' ) . append ( `<option value="${ table [ i ] . name } ">${ table [ i ] . name } </option>` ) ;
114- console . log ( str ) ;
107+ function isInBuildKey ( map , name ) {
108+
109+ if ( name === 'all' ) {
110+ return true ;
111+ }
112+ for ( let i = 0 ; i < map . length ; i ++ ) {
113+ return flightModes . includes ( name ) ;
115114 }
116115}
117116
118117function isFlightMode ( name ) {
119118 return flightModes . includes ( name ) ;
120119}
121120
121+ function createCategorySelect ( table ) {
122+ let categorySelect = $ ( 'select.auxiliary_category_select' ) ;
123+
124+ for ( let i = 0 ; i < table . length ; i ++ ) {
125+ if ( isInBuildKey ( buildMap , table [ i ] . buildKey ) ) {
126+ categorySelect . append ( `<option value="${ table [ i ] . name } ">${ table [ i ] . name } </option>` ) ;
127+ }
128+ }
129+ }
130+
122131auxiliary . initialize = function ( callback ) {
123132 GUI . active_tab_ref = this ;
124133 GUI . active_tab = 'auxiliary' ;
@@ -410,7 +419,6 @@ auxiliary.initialize = function (callback) {
410419
411420 // translate to user-selected language
412421 i18n . localizePage ( ) ;
413- //categoryFieldsSelect
414422
415423 // generate category multiple select
416424 displayTable ( categoryTable ) ;
0 commit comments