@@ -54,6 +54,11 @@ import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
54
54
55
55
import { getUrls } from '../app/utils' ;
56
56
57
+ // Add interface for app configuration
58
+ interface AppConfig {
59
+ SHOW_KEYS_ENABLED : boolean ;
60
+ }
61
+
57
62
export const GroupHeader = styled ( 'div' ) ( ( { theme } ) => ( {
58
63
position : 'sticky' ,
59
64
padding : '8px 8px' ,
@@ -76,6 +81,19 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
76
81
const [ modelDialogOpen , setModelDialogOpen ] = useState < boolean > ( false ) ;
77
82
const [ showKeys , setShowKeys ] = useState < boolean > ( false ) ;
78
83
const [ tempSelectedModelId , setTempSelectedModeId ] = useState < string | undefined > ( selectedModelId ) ;
84
+ const [ appConfig , setAppConfig ] = useState < AppConfig > ( { SHOW_KEYS_ENABLED : true } ) ;
85
+
86
+ // Fetch app configuration
87
+ useEffect ( ( ) => {
88
+ fetch ( getUrls ( ) . APP_CONFIG )
89
+ . then ( response => response . json ( ) )
90
+ . then ( data => {
91
+ setAppConfig ( data ) ;
92
+ } )
93
+ . catch ( error => {
94
+ console . error ( "Failed to fetch app configuration:" , error ) ;
95
+ } ) ;
96
+ } , [ ] ) ;
79
97
80
98
let updateModelStatus = ( model : ModelConfig , status : 'ok' | 'error' | 'testing' | 'unknown' , message : string ) => {
81
99
dispatch ( dfActions . updateModelStatus ( { id : model . id , status, message} ) ) ;
@@ -454,10 +472,12 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
454
472
{ modelTable }
455
473
</ DialogContent >
456
474
< DialogActions >
457
- < Button sx = { { marginRight : 'auto' } } endIcon = { showKeys ? < VisibilityOffIcon /> : < VisibilityIcon /> } onClick = { ( ) => {
458
- setShowKeys ( ! showKeys ) ; } } >
459
- { showKeys ? 'hide' : 'show' } keys
460
- </ Button >
475
+ { appConfig . SHOW_KEYS_ENABLED && (
476
+ < Button sx = { { marginRight : 'auto' } } endIcon = { showKeys ? < VisibilityOffIcon /> : < VisibilityIcon /> } onClick = { ( ) => {
477
+ setShowKeys ( ! showKeys ) ; } } >
478
+ { showKeys ? 'hide' : 'show' } keys
479
+ </ Button >
480
+ ) }
461
481
< Button disabled = { getStatus ( tempSelectedModelId ) !== 'ok' }
462
482
variant = { ( selectedModelId == tempSelectedModelId ) ? 'text' : 'contained' }
463
483
onClick = { ( ) => {
0 commit comments