Skip to content

Commit 8a8d929

Browse files
feat(wren-ui): Support MySQL ssl (#1698)
1 parent c44b740 commit 8a8d929

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

wren-ui/src/apollo/server/dataSource.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,16 @@ const dataSource = {
123123
DataSourceName.MYSQL,
124124
connectionInfo,
125125
);
126-
const { host, port, database, user, password } =
126+
const { host, port, database, user, password, ssl } =
127127
decryptedConnectionInfo as MYSQL_CONNECTION_INFO;
128-
return { host, port, database, user, password };
128+
return {
129+
host,
130+
port,
131+
database,
132+
user,
133+
password,
134+
sslMode: ssl ? 'ENABLED' : 'DISABLED',
135+
};
129136
},
130137
} as IDataSourceConnectionInfo<
131138
MYSQL_CONNECTION_INFO,

wren-ui/src/apollo/server/repositories/projectRepository.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface MYSQL_CONNECTION_INFO {
3030
user: string;
3131
password: string;
3232
database: string;
33+
ssl: boolean;
3334
}
3435

3536
export interface ORACLE_CONNECTION_INFO {

wren-ui/src/components/pages/setup/dataSources/MySQLProperties.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Form, Input } from 'antd';
1+
import { Form, Input, Switch } from 'antd';
22
import { ERROR_TEXTS } from '@/utils/error';
33
import { FORM_MODE } from '@/utils/enum';
44
import { hostValidator } from '@/utils/validator';
@@ -82,6 +82,9 @@ export default function MySQLProperties(props: Props) {
8282
>
8383
<Input placeholder="MySQL database name" disabled={isEditMode} />
8484
</Form.Item>
85+
<Form.Item label="Use SSL" name="ssl" valuePropName="checked">
86+
<Switch />
87+
</Form.Item>
8588
</>
8689
);
8790
}

0 commit comments

Comments
 (0)