@@ -7,7 +7,7 @@ interface ConfigMenuProps {
77 onClose : ( ) => void ;
88}
99
10- type FieldType = "text" | "number" | "boolean" | "select" | "duration" ;
10+ type FieldType = "text" | "number" | "boolean" | "select" | "duration" | "numericSelect" ;
1111
1212interface FieldDef {
1313 key : keyof EmsConfig ;
@@ -19,6 +19,7 @@ interface FieldDef {
1919 max ?: number ;
2020 step ?: number ;
2121 options ?: string [ ] ;
22+ numericOptions ?: { value : number ; label : string } [ ] ;
2223 sensitive ?: boolean ;
2324}
2425
@@ -172,6 +173,17 @@ const SECTIONS: Section[] = [
172173 min : 1 ,
173174 hint : "Consecutive checks at current work mode required before upgrading" ,
174175 } ,
176+ {
177+ key : "miner_max_work_mode" ,
178+ label : "Max Work Mode" ,
179+ type : "numericSelect" ,
180+ numericOptions : [
181+ { value : 0 , label : "Eco" } ,
182+ { value : 1 , label : "Standard" } ,
183+ { value : 2 , label : "Super" } ,
184+ ] ,
185+ hint : "Highest work mode miners are allowed to reach" ,
186+ } ,
175187 {
176188 key : "miners_power_limit" ,
177189 label : "Total Power Limit" ,
@@ -511,7 +523,7 @@ function ConfigField({ def, value, onChange }: FieldProps) {
511523 onChange ( def . key , raw as boolean ) ;
512524 return ;
513525 }
514- if ( def . type === "number" ) {
526+ if ( def . type === "number" || def . type === "numericSelect" ) {
515527 const parsed = raw === "" ? 0 : Number ( raw ) ;
516528 onChange ( def . key , isNaN ( parsed ) ? 0 : parsed ) ;
517529 return ;
@@ -554,6 +566,18 @@ function ConfigField({ def, value, onChange }: FieldProps) {
554566 </ option >
555567 ) ) }
556568 </ select >
569+ ) : def . type === "numericSelect" ? (
570+ < select
571+ className = "config-input"
572+ value = { String ( value ?? 0 ) }
573+ onChange = { ( e ) => handleChange ( e . target . value ) }
574+ >
575+ { def . numericOptions ?. map ( ( opt ) => (
576+ < option key = { opt . value } value = { String ( opt . value ) } >
577+ { opt . label }
578+ </ option >
579+ ) ) }
580+ </ select >
557581 ) : def . type === "number" ? (
558582 < input
559583 type = "number"
0 commit comments