@@ -3,8 +3,9 @@ import { Form, Input, Select, Button, Upload } from 'antd';
3
3
import UploadOutlined from '@ant-design/icons/UploadOutlined' ;
4
4
import { UploadFile } from 'antd/lib/upload/interface' ;
5
5
import { ERROR_TEXTS } from '@/utils/error' ;
6
- import { FORM_MODE , SSL_MODE } from '@/utils/enum' ;
6
+ import { FORM_MODE } from '@/utils/enum' ;
7
7
import { hostValidator } from '@/utils/validator' ;
8
+ import { SSLMode } from '@/apollo/server/types' ;
8
9
9
10
interface Props {
10
11
mode ?: FORM_MODE ;
@@ -65,7 +66,7 @@ const UploadSSL = (props) => {
65
66
export default function MySQLProperties ( props : Props ) {
66
67
const { mode } = props ;
67
68
const isEditMode = mode === FORM_MODE . EDIT ;
68
- const [ sslMode , setSSLMode ] = useState < string > ( SSL_MODE . DISABLED ) ;
69
+ const [ sslMode , setSSLMode ] = useState < string > ( SSLMode . DISABLED ) ;
69
70
const onSSLModeChange = ( value : string ) => setSSLMode ( value )
70
71
return (
71
72
< >
@@ -146,20 +147,20 @@ export default function MySQLProperties(props: Props) {
146
147
>
147
148
< Input placeholder = "MySQL database name" disabled = { isEditMode } />
148
149
</ Form . Item >
149
- < Form . Item label = "SSL mode" name = "sslMode" initialValue = { SSL_MODE . DISABLED } >
150
+ < Form . Item label = "SSL mode" name = "sslMode" initialValue = { SSLMode . DISABLED } >
150
151
< Select
151
152
style = { { width : 120 } }
152
153
onChange = { onSSLModeChange }
153
154
disabled = { isEditMode }
154
155
options = { [
155
- { value : SSL_MODE . DISABLED , label : 'Disabled' } ,
156
- { value : SSL_MODE . ENABLED , label : 'Enabled' } ,
157
- { value : SSL_MODE . VERIFY_CA , label : 'Verify CA' } ,
156
+ { value : SSLMode . DISABLED , label : 'Disabled' } ,
157
+ { value : SSLMode . ENABLED , label : 'Enabled' } ,
158
+ { value : SSLMode . VERIFY_CA , label : 'Verify CA' } ,
158
159
] }
159
160
/>
160
161
</ Form . Item >
161
162
{
162
- sslMode === SSL_MODE . VERIFY_CA &&
163
+ sslMode === SSLMode . VERIFY_CA &&
163
164
< Form . Item
164
165
label = "SSL CA file"
165
166
name = "sslCA"
0 commit comments