@@ -16,7 +16,7 @@ import {
1616 RadioGroup ,
1717 Select ,
1818 VStack ,
19- Stack
19+ Stack ,
2020} from '@chakra-ui/react'
2121import { agent } from '@renderer/core/agent'
2222import { http_api_port } from '@root/common/constants'
@@ -67,8 +67,38 @@ const General = (props: IProps) => {
6767 </ HStack >
6868 </ FormControl >
6969
70+ < FormControl >
71+ < HStack alignItems = { 'flex-start' } >
72+ < FormLabel w = { label_width } > { lang . write_mode } </ FormLabel >
73+ < VStack align = "left" >
74+ < RadioGroup
75+ value = { data . write_mode || '' }
76+ onChange = { ( v ) =>
77+ onChange ( {
78+ write_mode : v as ConfigsType [ 'write_mode' ] ,
79+ } )
80+ }
81+ >
82+ < HStack spacing = { 10 } >
83+ < Radio value = "append" >
84+ < Box > { lang . append } </ Box >
85+ </ Radio >
86+ < Radio value = "overwrite" >
87+ < Box > { lang . overwrite } </ Box >
88+ </ Radio >
89+ </ HStack >
90+ </ RadioGroup >
91+ < FormHelperText maxW = { '350px' } >
92+ { data . write_mode === 'append' && lang . write_mode_append_help }
93+ { data . write_mode === 'overwrite' &&
94+ lang . write_mode_overwrite_help }
95+ </ FormHelperText >
96+ </ VStack >
97+ </ HStack >
98+ </ FormControl >
99+
70100 < FormControl pb = { 6 } >
71- < HStack >
101+ < HStack alignItems = { 'flex-start' } >
72102 < FormLabel w = { label_width } > { lang . choice_mode } </ FormLabel >
73103 < VStack align = "left" >
74104 < RadioGroup
@@ -90,7 +120,9 @@ const General = (props: IProps) => {
90120 </ Radio >
91121 </ HStack >
92122 </ RadioGroup >
93- < FormHelperText > { lang . choice_mode_desc } </ FormHelperText >
123+ < FormHelperText maxW = { '350px' } >
124+ { lang . choice_mode_desc }
125+ </ FormHelperText >
94126 </ VStack >
95127 </ HStack >
96128 </ FormControl >
@@ -163,9 +195,11 @@ const General = (props: IProps) => {
163195 </ FormHelperText >
164196 < Stack pl = { 6 } mt = { 1 } spacing = { 1 } >
165197 < Checkbox
166- isDisabled = { ! data . http_api_on }
167- isChecked = { data . http_api_only_local }
168- onChange = { ( e ) => onChange ( { http_api_only_local : e . target . checked } ) }
198+ isDisabled = { ! data . http_api_on }
199+ isChecked = { data . http_api_only_local }
200+ onChange = { ( e ) =>
201+ onChange ( { http_api_only_local : e . target . checked } )
202+ }
169203 >
170204 { lang . http_api_only_local }
171205 </ Checkbox >
0 commit comments