-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06bc68c
commit 046b04f
Showing
4 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
wren-ui/src/components/pages/setup/dataSources/ClickHouseProperties.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import { Form, Input, Switch } from 'antd'; | ||
import { ERROR_TEXTS } from '@/utils/error'; | ||
import { FORM_MODE } from '@/utils/enum'; | ||
|
||
interface Props { | ||
mode?: FORM_MODE; | ||
} | ||
|
||
export default function ClickHouseProperties(props: Props) { | ||
const { mode } = props; | ||
const isEditMode = mode === FORM_MODE.EDIT; | ||
return ( | ||
<> | ||
<Form.Item | ||
label="Display name" | ||
name="displayName" | ||
required | ||
rules={[ | ||
{ | ||
required: true, | ||
message: ERROR_TEXTS.CONNECTION.DISPLAY_NAME.REQUIRED, | ||
}, | ||
]} | ||
> | ||
<Input /> | ||
</Form.Item> | ||
<Form.Item | ||
label="Host" | ||
name="host" | ||
required | ||
rules={[ | ||
{ | ||
required: true, | ||
message: ERROR_TEXTS.CONNECTION.HOST.REQUIRED, | ||
}, | ||
]} | ||
> | ||
<Input | ||
placeholder="<your_click_house_account>.clickhouse.cloud" | ||
disabled={isEditMode} | ||
/> | ||
</Form.Item> | ||
<Form.Item | ||
label="Port" | ||
name="port" | ||
required | ||
rules={[ | ||
{ | ||
required: true, | ||
message: ERROR_TEXTS.CONNECTION.PORT.REQUIRED, | ||
}, | ||
]} | ||
> | ||
<Input placeholder="8443" disabled={isEditMode} /> | ||
</Form.Item> | ||
<Form.Item | ||
label="Username" | ||
name="user" | ||
rules={[ | ||
{ | ||
required: true, | ||
message: ERROR_TEXTS.CONNECTION.USERNAME.REQUIRED, | ||
}, | ||
]} | ||
> | ||
<Input /> | ||
</Form.Item> | ||
<Form.Item | ||
label="Password" | ||
name="password" | ||
required | ||
rules={[ | ||
{ | ||
required: true, | ||
message: ERROR_TEXTS.CONNECTION.PASSWORD.REQUIRED, | ||
}, | ||
]} | ||
> | ||
<Input.Password placeholder="input password" /> | ||
</Form.Item> | ||
<Form.Item | ||
label="Database name" | ||
name="database" | ||
required | ||
rules={[ | ||
{ | ||
required: true, | ||
message: ERROR_TEXTS.CONNECTION.DATABASE.REQUIRED, | ||
}, | ||
]} | ||
> | ||
<Input placeholder="ClickHouse database name" disabled={isEditMode} /> | ||
</Form.Item> | ||
<Form.Item label="Use SSL" name="ssl" valuePropName="checked"> | ||
<Switch /> | ||
</Form.Item> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters