Skip to content

Commit

Permalink
Removed extra SSL mode enum file
Browse files Browse the repository at this point in the history
  • Loading branch information
ongdisheng committed Jan 24, 2025
1 parent 2c1ef7f commit 522c231
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Form, Input, Select, Button, Upload } from 'antd';
import UploadOutlined from '@ant-design/icons/UploadOutlined';
import { UploadFile } from 'antd/lib/upload/interface';
import { ERROR_TEXTS } from '@/utils/error';
import { FORM_MODE, SSL_MODE } from '@/utils/enum';
import { FORM_MODE } from '@/utils/enum';
import { hostValidator } from '@/utils/validator';
import { SSLMode } from '@/apollo/server/types';

interface Props {
mode?: FORM_MODE;
Expand Down Expand Up @@ -65,7 +66,7 @@ const UploadSSL = (props) => {
export default function MySQLProperties(props: Props) {
const { mode } = props;
const isEditMode = mode === FORM_MODE.EDIT;
const [sslMode, setSSLMode] = useState<string>(SSL_MODE.DISABLED);
const [sslMode, setSSLMode] = useState<string>(SSLMode.DISABLED);
const onSSLModeChange = (value: string) => setSSLMode(value)
return (
<>
Expand Down Expand Up @@ -146,20 +147,20 @@ export default function MySQLProperties(props: Props) {
>
<Input placeholder="MySQL database name" disabled={isEditMode} />
</Form.Item>
<Form.Item label="SSL mode" name="sslMode" initialValue={SSL_MODE.DISABLED}>
<Form.Item label="SSL mode" name="sslMode" initialValue={SSLMode.DISABLED}>
<Select
style={{ width: 120 }}
onChange={onSSLModeChange}
disabled={isEditMode}
options={[
{ value: SSL_MODE.DISABLED, label: 'Disabled' },
{ value: SSL_MODE.ENABLED, label: 'Enabled' },
{ value: SSL_MODE.VERIFY_CA, label: 'Verify CA' },
{ value: SSLMode.DISABLED, label: 'Disabled' },
{ value: SSLMode.ENABLED, label: 'Enabled' },
{ value: SSLMode.VERIFY_CA, label: 'Verify CA' },
]}
/>
</Form.Item>
{
sslMode === SSL_MODE.VERIFY_CA &&
sslMode === SSLMode.VERIFY_CA &&
<Form.Item
label="SSL CA file"
name="sslCA"
Expand Down
1 change: 0 additions & 1 deletion wren-ui/src/utils/enum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export * from './path';
export * from './diagram';
export * from './home';
export * from './settings';
export * from './sslMode';
5 changes: 0 additions & 5 deletions wren-ui/src/utils/enum/sslMode.ts

This file was deleted.

0 comments on commit 522c231

Please sign in to comment.