Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Oct 25, 2023
1 parent 898d84a commit 648abd6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/common/datasource/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export interface IDataSourceModeConfig {
sys: boolean;
ssl: boolean;
defaultSchema?: boolean;
jdbcDoc?: string;
};
features: {
task: TaskType[];
Expand Down
2 changes: 2 additions & 0 deletions src/common/datasource/mysql/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ const items: Record<ConnectType.MYSQL, IDataSourceModeConfig> = {
account: true,
sys: false,
ssl: false,
jdbcDoc:
'https://dev.mysql.com/doc/connector-j/8.1/en/connector-j-reference-configuration-properties.html',
},
features: {
task: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function Editor({ value, onChange }: IProps) {
bordered
editorProps={{
value,
theme: 'obwhite',
}}
initialSQL={value}
language={'sql'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { formatMessage } from '@/util/intl';
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
import { DataGridRef } from '@oceanbase-odc/ob-react-data-grid';
import { Form, Space } from 'antd';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
import DatasourceFormContext from '../context';
type IValue = Record<string, string>;
interface IProps {
value?: IValue;
Expand All @@ -36,6 +37,7 @@ function JDBCParamsItem() {
}
const JDBCParams: React.FC<IProps> = function ({ value, onChange }) {
const gridRef = useRef<DataGridRef>();
const context = useContext(DatasourceFormContext);
const [innerValue, setInnerValue] = useState<
{
name: string;
Expand Down Expand Up @@ -159,7 +161,10 @@ const JDBCParams: React.FC<IProps> = function ({ value, onChange }) {
属性配置 */
}{' '}
<a
href="https://www.oceanbase.com/docs/common-oceanbase-connector-j-cn-1000000000130260"
href={
context?.dataSourceConfig?.jdbcDoc ||
'https://www.oceanbase.com/docs/common-oceanbase-connector-j-cn-1000000000130260'
}
target="_blank"
>
{
Expand Down Expand Up @@ -197,6 +202,7 @@ const JDBCParams: React.FC<IProps> = function ({ value, onChange }) {
/>
</Toolbar>
<EditableTable
theme="white"
gridRef={gridRef}
readonly={false}
onRowsChange={onRowsChange}
Expand Down

0 comments on commit 648abd6

Please sign in to comment.