@@ -54,6 +54,11 @@ import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
5454
5555import { getUrls } from '../app/utils' ;
5656
57+ // Add interface for app configuration
58+ interface AppConfig {
59+ SHOW_KEYS_ENABLED : boolean ;
60+ }
61+
5762export const GroupHeader = styled ( 'div' ) ( ( { theme } ) => ( {
5863 position : 'sticky' ,
5964 padding : '8px 8px' ,
@@ -84,6 +89,19 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
8489 'ollama' : [ ]
8590 } ) ;
8691 const [ isLoadingModelOptions , setIsLoadingModelOptions ] = useState < boolean > ( false ) ;
92+ const [ appConfig , setAppConfig ] = useState < AppConfig > ( { SHOW_KEYS_ENABLED : true } ) ;
93+
94+ // Fetch app configuration
95+ useEffect ( ( ) => {
96+ fetch ( getUrls ( ) . APP_CONFIG )
97+ . then ( response => response . json ( ) )
98+ . then ( data => {
99+ setAppConfig ( data ) ;
100+ } )
101+ . catch ( error => {
102+ console . error ( "Failed to fetch app configuration:" , error ) ;
103+ } ) ;
104+ } , [ ] ) ;
87105
88106 let updateModelStatus = ( model : ModelConfig , status : 'ok' | 'error' | 'testing' | 'unknown' , message : string ) => {
89107 dispatch ( dfActions . updateModelStatus ( { id : model . id , status, message} ) ) ;
@@ -509,10 +527,12 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
509527 { modelTable }
510528 </ DialogContent >
511529 < DialogActions >
512- < Button sx = { { marginRight : 'auto' } } endIcon = { showKeys ? < VisibilityOffIcon /> : < VisibilityIcon /> } onClick = { ( ) => {
513- setShowKeys ( ! showKeys ) ; } } >
514- { showKeys ? 'hide' : 'show' } keys
515- </ Button >
530+ { appConfig . SHOW_KEYS_ENABLED && (
531+ < Button sx = { { marginRight : 'auto' } } endIcon = { showKeys ? < VisibilityOffIcon /> : < VisibilityIcon /> } onClick = { ( ) => {
532+ setShowKeys ( ! showKeys ) ; } } >
533+ { showKeys ? 'hide' : 'show' } keys
534+ </ Button >
535+ ) }
516536 < Button disabled = { getStatus ( tempSelectedModelId ) !== 'ok' }
517537 variant = { ( selectedModelId == tempSelectedModelId ) ? 'text' : 'contained' }
518538 onClick = { ( ) => {
0 commit comments