File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import SignInModal from "./signin";
55import { useSettingsStore , generateOpenAIModelConfig } from "./store" ;
66import MonacoEditor from "@monaco-editor/react" ;
77import { settingsAPI } from "./views/api" ;
8+ import * as yaml from 'js-yaml' ;
89import {
910 Input ,
1011 Switch ,
@@ -604,11 +605,16 @@ action_guard_client: *client
604605 Advanced Configuration (YAML)
605606 </ div >
606607 < MonacoEditor
607- value = { config . model_configs }
608+ value = { yaml . dump ( config . model_client_configs ) }
608609 onChange = { ( value ) => {
609- handleUpdateConfig ( {
610- model_configs : value ,
611- } ) ;
610+ try {
611+ const parsed = yaml . load ( value || '' ) ;
612+ handleUpdateConfig ( {
613+ model_client_configs : parsed ,
614+ } ) ;
615+ } catch ( e ) {
616+ // Invalid YAML, don't update
617+ }
612618 } }
613619 language = "yaml"
614620 height = "300px"
You can’t perform that action at this time.
0 commit comments