@@ -16,7 +16,7 @@ import {
16
16
RadioGroup ,
17
17
Select ,
18
18
VStack ,
19
- Stack
19
+ Stack ,
20
20
} from '@chakra-ui/react'
21
21
import { agent } from '@renderer/core/agent'
22
22
import { http_api_port } from '@root/common/constants'
@@ -67,8 +67,38 @@ const General = (props: IProps) => {
67
67
</ HStack >
68
68
</ FormControl >
69
69
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
+
70
100
< FormControl pb = { 6 } >
71
- < HStack >
101
+ < HStack alignItems = { 'flex-start' } >
72
102
< FormLabel w = { label_width } > { lang . choice_mode } </ FormLabel >
73
103
< VStack align = "left" >
74
104
< RadioGroup
@@ -90,7 +120,9 @@ const General = (props: IProps) => {
90
120
</ Radio >
91
121
</ HStack >
92
122
</ RadioGroup >
93
- < FormHelperText > { lang . choice_mode_desc } </ FormHelperText >
123
+ < FormHelperText maxW = { '350px' } >
124
+ { lang . choice_mode_desc }
125
+ </ FormHelperText >
94
126
</ VStack >
95
127
</ HStack >
96
128
</ FormControl >
@@ -163,9 +195,11 @@ const General = (props: IProps) => {
163
195
</ FormHelperText >
164
196
< Stack pl = { 6 } mt = { 1 } spacing = { 1 } >
165
197
< 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
+ }
169
203
>
170
204
{ lang . http_api_only_local }
171
205
</ Checkbox >
0 commit comments