|
@@ -237,7 +237,7 @@ export default function DatasourceAdd({ updateDataSource }) {
|
|
|
title="添加数据源"
|
|
|
modalProps={{
|
|
|
destroyOnClose: true,
|
|
|
- width: '60%',
|
|
|
+ width: '70%',
|
|
|
afterClose: () => {
|
|
|
setDataType(DATA_TYPE_MYSQL)
|
|
|
setKerbsValid(KERBS_VALID_FALSE)
|
|
@@ -248,7 +248,7 @@ export default function DatasourceAdd({ updateDataSource }) {
|
|
|
}}
|
|
|
layout="horizontal"
|
|
|
grid={true}
|
|
|
- labelCol={{ span: 7 }}
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
colProps={{ span: 12 }}
|
|
|
rowProps={{
|
|
|
gutter: [45, 0],
|
|
@@ -319,26 +319,32 @@ export default function DatasourceAdd({ updateDataSource }) {
|
|
|
},
|
|
|
]}
|
|
|
/>
|
|
|
- <ProFormText
|
|
|
- label="用户名"
|
|
|
- name="jdbc_username"
|
|
|
- rules={[
|
|
|
- {
|
|
|
- required: !kerbsValid ? true : false,
|
|
|
- message: '请输入用户名!',
|
|
|
- },
|
|
|
- ]}
|
|
|
- />
|
|
|
- <ProFormText.Password
|
|
|
- label="密码"
|
|
|
- name="jdbc_password"
|
|
|
- rules={[
|
|
|
- {
|
|
|
- required: !kerbsValid ? true : false,
|
|
|
- message: '请输入密码!',
|
|
|
- },
|
|
|
- ]}
|
|
|
- />
|
|
|
+ {!kerbsValid && (
|
|
|
+ <ProFormText
|
|
|
+ label="用户名"
|
|
|
+ name="jdbc_username"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入用户名!',
|
|
|
+ },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {kerbsValid && <ProFormText label="用户名" name="jdbc_username" />}
|
|
|
+ {!kerbsValid && (
|
|
|
+ <ProFormText.Password
|
|
|
+ label="密码"
|
|
|
+ name="jdbc_password"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入密码!',
|
|
|
+ },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {kerbsValid && <ProFormText.Password label="密码" name="jdbc_password" />}
|
|
|
<ProFormTextArea
|
|
|
label="详情"
|
|
|
name="comments"
|