Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
3114c400
Unverified
Commit
3114c400
authored
Feb 02, 2023
by
zhu-mingye
Committed by
GitHub
Feb 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: delete database alias (#1598)
* refactor: delete database alias * format code * refactor: delete database tsx * format code * format code * format code
parent
623fc445
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
9 additions
and
324 deletions
+9
-324
DataBase.java
dinky-admin/src/main/java/org/dinky/model/DataBase.java
+0
-9
DataBaseMapper.xml
dinky-admin/src/main/resources/mapper/DataBaseMapper.xml
+0
-3
dinky.sql
dinky-doc/sql/dinky.sql
+0
-1
dinky_ddl.sql
dinky-doc/sql/upgrade/0.8.0_schema/mysql/dinky_ddl.sql
+1
-1
index.tsx
...components/Studio/StudioLeftTool/StudioDataBase/index.tsx
+0
-282
index.tsx
...components/Studio/StudioLeftTool/StudioMetaData/index.tsx
+3
-3
index.tsx
dlink-web/src/components/Studio/StudioLeftTool/index.tsx
+0
-4
index.tsx
...mponents/Studio/StudioRightTool/StudioSqlConfig/index.tsx
+1
-1
pages.ts
dlink-web/src/locales/en-US/pages.ts
+0
-2
pages.ts
dlink-web/src/locales/zh-CN/pages.ts
+0
-2
DBForm.tsx
...c/pages/RegistrationCenter/DataBase/components/DBForm.tsx
+1
-1
DataBaseForm.tsx
...s/RegistrationCenter/DataBase/components/DataBaseForm.tsx
+1
-9
index.tsx
dlink-web/src/pages/RegistrationCenter/DataBase/index.tsx
+2
-5
data.d.ts
dlink-web/src/pages/RegistrationCenter/data.d.ts
+0
-1
No files found.
dinky-admin/src/main/java/org/dinky/model/DataBase.java
View file @
3114c400
...
@@ -24,8 +24,6 @@ import org.dinky.metadata.driver.DriverConfig;
...
@@ -24,8 +24,6 @@ import org.dinky.metadata.driver.DriverConfig;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -46,17 +44,10 @@ public class DataBase extends SuperEntity {
...
@@ -46,17 +44,10 @@ public class DataBase extends SuperEntity {
private
Integer
tenantId
;
private
Integer
tenantId
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
String
alias
;
private
String
groupName
;
private
String
groupName
;
private
String
type
;
private
String
type
;
private
String
url
;
private
String
url
;
private
String
username
;
private
String
username
;
private
String
password
;
private
String
password
;
private
String
note
;
private
String
note
;
...
...
dinky-admin/src/main/resources/mapper/DataBaseMapper.xml
View file @
3114c400
...
@@ -12,9 +12,6 @@
...
@@ -12,9 +12,6 @@
<if
test=
'param.name!=null and param.name!=""'
>
<if
test=
'param.name!=null and param.name!=""'
>
and a.name like "%${param.name}%"
and a.name like "%${param.name}%"
</if>
</if>
<if
test=
'param.alias!=null and param.alias!=""'
>
and a.alias like "%${param.alias}%"
</if>
<if
test=
'param.createTime!=null and param.createTime!=""'
>
<if
test=
'param.createTime!=null and param.createTime!=""'
>
and a.create_time
<![CDATA[>=]]>
str_to_date( #{param.createTime},'%Y-%m-%d %H:%i:%s')
and a.create_time
<![CDATA[>=]]>
str_to_date( #{param.createTime},'%Y-%m-%d %H:%i:%s')
</if>
</if>
...
...
dinky-doc/sql/dinky.sql
View file @
3114c400
...
@@ -168,7 +168,6 @@ CREATE TABLE `dinky_database` (
...
@@ -168,7 +168,6 @@ CREATE TABLE `dinky_database` (
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'ID'
,
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'ID'
,
`tenant_id`
int
(
11
)
NOT
NULL
DEFAULT
1
COMMENT
'tenant id'
,
`tenant_id`
int
(
11
)
NOT
NULL
DEFAULT
1
COMMENT
'tenant id'
,
`name`
varchar
(
30
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
COMMENT
'database name'
,
`name`
varchar
(
30
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
COMMENT
'database name'
,
`alias`
varchar
(
50
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
COMMENT
'database alias'
,
`group_name`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
DEFAULT
'Default'
COMMENT
'database belong group name'
,
`group_name`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
DEFAULT
'Default'
COMMENT
'database belong group name'
,
`type`
varchar
(
50
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
COMMENT
'database type'
,
`type`
varchar
(
50
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NOT
NULL
COMMENT
'database type'
,
`ip`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
DEFAULT
NULL
COMMENT
'database ip'
,
`ip`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
DEFAULT
NULL
COMMENT
'database ip'
,
...
...
dinky-doc/sql/upgrade/0.8.0_schema/mysql/dinky_ddl.sql
View file @
3114c400
...
@@ -71,4 +71,4 @@ ALTER TABLE dinky_catalogue RENAME INDEX `dlink_catalogue_un` TO `catalogue_un_i
...
@@ -71,4 +71,4 @@ ALTER TABLE dinky_catalogue RENAME INDEX `dlink_catalogue_un` TO `catalogue_un_i
ALTER
TABLE
dinky_schema_history
RENAME
INDEX
`dlink_schema_history_s_idx`
TO
`schema_history_idx`
;
ALTER
TABLE
dinky_schema_history
RENAME
INDEX
`dlink_schema_history_s_idx`
TO
`schema_history_idx`
;
ALTER
TABLE
dinky_database
DROP
COLUMN
`alias`
;
dlink-web/src/components/Studio/StudioLeftTool/StudioDataBase/index.tsx
deleted
100644 → 0
View file @
623fc445
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import
{
Button
,
Drawer
,
Empty
,
Modal
,
Table
,
Tooltip
}
from
"antd"
;
import
{
StateType
}
from
"@/pages/DataStudio/model"
;
import
{
connect
}
from
"umi"
;
import
React
,
{
useState
}
from
"react"
;
import
{
PlusOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
showDataBase
}
from
"../../StudioEvent/DDL"
;
import
DBForm
from
"@/pages/RegistrationCenter/DataBase/components/DBForm"
;
import
{
Scrollbars
}
from
'react-custom-scrollbars'
;
import
ProDescriptions
from
"@ant-design/pro-descriptions"
;
import
{
handleRemove
}
from
"@/components/Common/crud"
;
import
{
l
}
from
"@/utils/intl"
;
const
StudioDataBase
=
(
props
:
any
)
=>
{
const
{
database
,
toolHeight
,
dispatch
}
=
props
;
const
[
chooseDBModalVisible
,
handleDBFormModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
values
,
setValues
]
=
useState
<
any
>
({});
const
[
row
,
setRow
]
=
useState
<
{}
>
();
const
getColumns
=
()
=>
{
return
[{
title
:
"数据源名"
,
dataIndex
:
"alias"
,
key
:
"alias"
,
sorter
:
true
,
render
:
(
dom
,
entity
)
=>
{
return
<
a
onClick=
{
()
=>
setRow
(
entity
)
}
>
{
entity
.
alias
===
""
?
entity
.
name
:
entity
.
alias
}
</
a
>;
},
}];
};
const
getAllColumns
=
()
=>
{
return
[{
title
:
"ID"
,
dataIndex
:
"id"
,
key
:
"id"
,
},
{
title
:
"数据源名"
,
dataIndex
:
"alias"
,
},
{
title
:
'唯一标识'
,
dataIndex
:
'name'
,
},
{
title
:
'分组类型'
,
dataIndex
:
'groupName'
,
filters
:
[
{
text
:
'来源'
,
value
:
'来源'
,
},
{
text
:
'数仓'
,
value
:
'数仓'
,
},
{
text
:
'应用'
,
value
:
'应用'
,
},
{
text
:
'备份'
,
value
:
'备份'
,
},
{
text
:
'其他'
,
value
:
'其他'
,
},
],
filterMultiple
:
false
,
valueEnum
:
{
'yarn-session'
:
{
text
:
'Yarn Session'
},
'standalone'
:
{
text
:
'Standalone'
},
'yarn-per-job'
:
{
text
:
'Yarn Per-Job'
},
'yarn-application'
:
{
text
:
'Yarn Application'
},
},
},
{
title
:
'URL'
,
dataIndex
:
'url'
,
valueType
:
'textarea'
,
},
{
title
:
'用户名'
,
dataIndex
:
'username'
,
},
{
title
:
'版本'
,
sorter
:
true
,
dataIndex
:
'dbVersion'
,
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
filters
:
[
{
text
:
'正常'
,
value
:
1
,
},
{
text
:
'异常'
,
value
:
0
,
},
],
filterMultiple
:
false
,
valueEnum
:
{
1
:
{
text
:
'正常'
,
status
:
'Success'
},
0
:
{
text
:
'异常'
,
status
:
'Error'
},
},
},
{
title
:
l
(
'global.table.note'
),
sorter
:
true
,
valueType
:
'textarea'
,
dataIndex
:
'note'
,
},
{
title
:
l
(
'global.table.isEnable'
),
dataIndex
:
'enabled'
,
filters
:
[
{
text
:
l
(
'status.enabled'
),
value
:
1
,
},
{
text
:
l
(
'status.disabled'
),
value
:
0
,
},
],
filterMultiple
:
false
,
valueEnum
:
{
true
:
{
text
:
l
(
'status.enabled'
),
status
:
'Success'
},
false
:
{
text
:
l
(
'status.disabled'
),
status
:
'Error'
},
},
},
{
title
:
'最近的健康时间'
,
dataIndex
:
'healthTime'
,
valueType
:
'dateTime'
,
},
{
title
:
'最近的心跳检测时间'
,
dataIndex
:
'heartbeatTime'
,
valueType
:
'dateTime'
,
},
{
title
:
l
(
'global.table.createTime'
),
dataIndex
:
'createTime'
,
valueType
:
'dateTime'
,
},
{
title
:
l
(
'global.table.lastUpdateTime'
),
dataIndex
:
'updateTime'
,
valueType
:
'dateTime'
,
},
{
title
:
l
(
'global.table.operate'
),
dataIndex
:
'option'
,
valueType
:
'option'
,
render
:
(
_
,
record
)
=>
[
<
Button
type=
"dashed"
onClick=
{
()
=>
onModifyDataBase
(
record
)
}
>
{
l
(
'button.edit'
)
}
</
Button
>,
<
Button
danger
onClick=
{
()
=>
onDeleteDataBase
(
record
)
}
>
{
l
(
'button.delete'
)
}
</
Button
>
],
},];
};
const
onRefreshDataBase
=
()
=>
{
showDataBase
(
dispatch
);
};
const
onCreateDataBase
=
()
=>
{
setValues
({});
handleDBFormModalVisible
(
true
);
};
const
onModifyDataBase
=
(
record
)
=>
{
setValues
(
record
);
handleDBFormModalVisible
(
true
);
};
const
onDeleteDataBase
=
(
record
)
=>
{
Modal
.
confirm
({
title
:
'删除数据源'
,
content
:
`确定删除该数据源【
${
record
.
alias
===
""
?
record
.
name
:
record
.
alias
}
】吗?`
,
okText
:
l
(
'button.confirm'
),
cancelText
:
l
(
'button.cancel'
),
onOk
:
async
()
=>
{
await
handleRemove
(
'api/database'
,
[
record
]);
setRow
({});
onRefreshDataBase
();
}
});
};
return
(
<>
<
Tooltip
title=
"新建数据源"
>
<
Button
type=
"text"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
onCreateDataBase
}
/>
</
Tooltip
>
<
Tooltip
title=
"刷新数据源"
>
<
Button
type=
"text"
icon=
{
<
ReloadOutlined
/>
}
onClick=
{
onRefreshDataBase
}
/>
</
Tooltip
>
<
Scrollbars
style=
{
{
height
:
(
toolHeight
-
32
)}
}
>
{
database
.
length
>
0
?
(
<
Table
dataSource=
{
database
}
columns=
{
getColumns
()
}
pagination=
{
{
defaultPageSize
:
10
,
showSizeChanger
:
true
,
}
}
size=
"small"
/>)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>)
}
<
DBForm
onCancel=
{
()
=>
{
handleDBFormModalVisible
(
false
);
setValues
({});
}
}
modalVisible=
{
chooseDBModalVisible
}
onSubmit=
{
()
=>
{
setRow
({});
onRefreshDataBase
();
}
}
values=
{
values
}
/>
<
Drawer
width=
{
600
}
visible=
{
!!
row
?.
id
}
onClose=
{
()
=>
{
setRow
(
undefined
);
}
}
closable=
{
false
}
>
{
row
?.
name
&&
(
<
ProDescriptions
column=
{
2
}
title=
{
row
?.
name
}
request=
{
async
()
=>
({
data
:
row
||
{},
})
}
params=
{
{
id
:
row
?.
name
,
}
}
columns=
{
getAllColumns
()
}
/>
)
}
</
Drawer
>
</
Scrollbars
>
</>
);
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
database
:
Studio
.
database
,
toolHeight
:
Studio
.
toolHeight
,
}))(
StudioDataBase
);
dlink-web/src/components/Studio/StudioLeftTool/StudioMetaData/index.tsx
View file @
3114c400
...
@@ -90,10 +90,10 @@ const StudioMetaData = (props: any) => {
...
@@ -90,10 +90,10 @@ const StudioMetaData = (props: any) => {
};
};
const
getDataBaseOptions
=
()
=>
{
const
getDataBaseOptions
=
()
=>
{
return
<>
{
database
.
map
(({
id
,
name
,
alias
,
type
,
enabled
})
=>
(
return
<>
{
database
.
map
(({
id
,
name
,
type
,
enabled
})
=>
(
<
Option
value=
{
id
}
<
Option
value=
{
id
}
label=
{
<><
Tag
color=
{
enabled
?
"processing"
:
"error"
}
>
{
type
}
</
Tag
>
{
alias
===
""
?
name
:
alias
}
</>
}
>
label=
{
<><
Tag
color=
{
enabled
?
"processing"
:
"error"
}
>
{
type
}
</
Tag
>
{
name
}
</>
}
>
<
Tag
color=
{
enabled
?
"processing"
:
"error"
}
>
{
type
}
</
Tag
>
{
alias
===
""
?
name
:
alias
}
<
Tag
color=
{
enabled
?
"processing"
:
"error"
}
>
{
type
}
</
Tag
>
{
name
}
</
Option
>
</
Option
>
))
}
</>
))
}
</>
};
};
...
...
dlink-web/src/components/Studio/StudioLeftTool/index.tsx
View file @
3114c400
...
@@ -49,10 +49,6 @@ const StudioLeftTool = (props: any) => {
...
@@ -49,10 +49,6 @@ const StudioLeftTool = (props: any) => {
{
/*<TabPane tab={<span><ClusterOutlined/> {l('pages.datastudio.label.cluster')}</span>} key="Cluster">*/
}
{
/*<TabPane tab={<span><ClusterOutlined/> {l('pages.datastudio.label.cluster')}</span>} key="Cluster">*/
}
{
/* <StudioCluster/>*/
}
{
/* <StudioCluster/>*/
}
{
/*</TabPane>*/
}
{
/*</TabPane>*/
}
{
/*<TabPane tab={<span><DatabaseOutlined/> {l('pages.datastudio.label.datasource')}</span>}*/
}
{
/* key="DataSource">*/
}
{
/* <StudioDataBase/>*/
}
{
/*</TabPane>*/
}
<
TabPane
tab=
{
<
span
><
AppstoreOutlined
/>
{
l
(
'pages.datastudio.label.meta'
)
}
</
span
>
}
key=
"MetaData"
>
<
TabPane
tab=
{
<
span
><
AppstoreOutlined
/>
{
l
(
'pages.datastudio.label.meta'
)
}
</
span
>
}
key=
"MetaData"
>
<
StudioMetaData
/>
<
StudioMetaData
/>
</
TabPane
>
</
TabPane
>
...
...
dlink-web/src/components/Studio/StudioRightTool/StudioSqlConfig/index.tsx
View file @
3114c400
...
@@ -57,7 +57,7 @@ const StudioSqlConfig = (props: any) => {
...
@@ -57,7 +57,7 @@ const StudioSqlConfig = (props: any) => {
for
(
const
item
of
database
)
{
for
(
const
item
of
database
)
{
if
(
item
.
type
.
toUpperCase
()
===
current
.
task
.
dialect
.
toUpperCase
())
{
if
(
item
.
type
.
toUpperCase
()
===
current
.
task
.
dialect
.
toUpperCase
())
{
const
tag
=
(<><
Tag
const
tag
=
(<><
Tag
color=
{
item
.
enabled
?
"processing"
:
"error"
}
>
{
item
.
type
}
</
Tag
>
{
item
.
alias
===
""
?
item
.
name
:
item
.
alias
}
</>);
color=
{
item
.
enabled
?
"processing"
:
"error"
}
>
{
item
.
type
}
</
Tag
>
{
item
.
name
}
</>);
itemList
.
push
(<
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
label=
{
tag
}
>
itemList
.
push
(<
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
label=
{
tag
}
>
{
tag
}
{
tag
}
</
Option
>)
</
Option
>)
...
...
dlink-web/src/locales/en-US/pages.ts
View file @
3114c400
...
@@ -703,7 +703,6 @@ export default {
...
@@ -703,7 +703,6 @@ export default {
'pages.rc.db.Management'
:
'DataSource'
,
'pages.rc.db.Management'
:
'DataSource'
,
'pages.rc.db.name'
:
'Name'
,
'pages.rc.db.name'
:
'Name'
,
'pages.rc.db.alias'
:
'Alias'
,
'pages.rc.db.groupName'
:
'Group Type'
,
'pages.rc.db.groupName'
:
'Group Type'
,
'pages.rc.db.url'
:
'Database Connection URL'
,
'pages.rc.db.url'
:
'Database Connection URL'
,
'pages.rc.db.username'
:
'Username'
,
'pages.rc.db.username'
:
'Username'
,
...
@@ -714,7 +713,6 @@ export default {
...
@@ -714,7 +713,6 @@ export default {
'pages.rc.db.modify'
:
'Modify DataSource'
,
'pages.rc.db.modify'
:
'Modify DataSource'
,
'pages.rc.db.delete'
:
'Delete DataSource'
,
'pages.rc.db.delete'
:
'Delete DataSource'
,
'pages.rc.db.deleteConfirm'
:
'Are you sure you want to delete this data source {dbName}? '
,
'pages.rc.db.deleteConfirm'
:
'Are you sure you want to delete this data source {dbName}? '
,
'pages.rc.db.aliasPlaceholder'
:
'Please enter alias!'
,
'pages.rc.db.namePlaceholder'
:
'Please enter name!'
,
'pages.rc.db.namePlaceholder'
:
'Please enter name!'
,
'pages.rc.db.urlPlaceholder'
:
'Please enter a properly formatted url connection!'
,
'pages.rc.db.urlPlaceholder'
:
'Please enter a properly formatted url connection!'
,
'pages.rc.db.flinkConfigPlaceholder'
:
'Please specify the default Config of Flink With!'
,
'pages.rc.db.flinkConfigPlaceholder'
:
'Please specify the default Config of Flink With!'
,
...
...
dlink-web/src/locales/zh-CN/pages.ts
View file @
3114c400
...
@@ -705,7 +705,6 @@ export default {
...
@@ -705,7 +705,6 @@ export default {
'pages.rc.db.Management'
:
'数据源'
,
'pages.rc.db.Management'
:
'数据源'
,
'pages.rc.db.name'
:
'名称'
,
'pages.rc.db.name'
:
'名称'
,
'pages.rc.db.alias'
:
'别名'
,
'pages.rc.db.groupName'
:
'分组类型'
,
'pages.rc.db.groupName'
:
'分组类型'
,
'pages.rc.db.url'
:
'数据库连接 URL'
,
'pages.rc.db.url'
:
'数据库连接 URL'
,
'pages.rc.db.username'
:
'用户名'
,
'pages.rc.db.username'
:
'用户名'
,
...
@@ -716,7 +715,6 @@ export default {
...
@@ -716,7 +715,6 @@ export default {
'pages.rc.db.modify'
:
'修改数据源'
,
'pages.rc.db.modify'
:
'修改数据源'
,
'pages.rc.db.delete'
:
'删除数据源'
,
'pages.rc.db.delete'
:
'删除数据源'
,
'pages.rc.db.deleteConfirm'
:
'确定删除该数据源{dbName}吗?'
,
'pages.rc.db.deleteConfirm'
:
'确定删除该数据源{dbName}吗?'
,
'pages.rc.db.aliasPlaceholder'
:
'请输入别名!'
,
'pages.rc.db.namePlaceholder'
:
'请输入名称!'
,
'pages.rc.db.namePlaceholder'
:
'请输入名称!'
,
'pages.rc.db.urlPlaceholder'
:
'请输入格式正确的 url 连接!'
,
'pages.rc.db.urlPlaceholder'
:
'请输入格式正确的 url 连接!'
,
'pages.rc.db.flinkConfigPlaceholder'
:
'请指定 Flink With 的默认配置!'
,
'pages.rc.db.flinkConfigPlaceholder'
:
'请指定 Flink With 的默认配置!'
,
...
...
dlink-web/src/pages/RegistrationCenter/DataBase/components/DBForm.tsx
View file @
3114c400
...
@@ -102,7 +102,7 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
...
@@ -102,7 +102,7 @@ const DBForm: React.FC<UpdateFormProps> = (props) => {
width=
{
"40%"
}
width=
{
"40%"
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
,
height
:
'600px'
,
overflowY
:
'auto'
}
}
bodyStyle=
{
{
padding
:
'32px 40px 48px'
,
height
:
'600px'
,
overflowY
:
'auto'
}
}
title=
{
values
.
id
?
l
(
'pages.rc.db.modify'
)
:
l
(
'pages.rc.db.create'
)
}
title=
{
values
.
id
?
l
(
'pages.rc.db.modify'
)
:
l
(
'pages.rc.db.create'
)
}
visible
=
{
modalVisible
}
open
=
{
modalVisible
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setDbType
(
undefined
);
setDbType
(
undefined
);
handleChooseDBModalVisible
();
handleChooseDBModalVisible
();
...
...
dlink-web/src/pages/RegistrationCenter/DataBase/components/DataBaseForm.tsx
View file @
3114c400
...
@@ -47,7 +47,6 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
...
@@ -47,7 +47,6 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
const
[
formVals
,
setFormVals
]
=
useState
<
Partial
<
DataBaseItem
>>
({
const
[
formVals
,
setFormVals
]
=
useState
<
Partial
<
DataBaseItem
>>
({
id
:
props
.
values
.
id
,
id
:
props
.
values
.
id
,
name
:
props
.
values
.
name
,
name
:
props
.
values
.
name
,
alias
:
props
.
values
.
alias
,
groupName
:
props
.
values
.
groupName
,
groupName
:
props
.
values
.
groupName
,
url
:
props
.
values
.
url
,
url
:
props
.
values
.
url
,
username
:
props
.
values
.
username
,
username
:
props
.
values
.
username
,
...
@@ -85,7 +84,7 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
...
@@ -85,7 +84,7 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
form
.
resetFields
();
form
.
resetFields
();
};
};
const
renderContent
=
(
formVals
)
=>
{
const
renderContent
=
(
formVals
:
Partial
<
DataBaseItem
>
)
=>
{
return
(
return
(
<>
<>
<
Divider
>
{
type
}
</
Divider
>
<
Divider
>
{
type
}
</
Divider
>
...
@@ -95,12 +94,6 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
...
@@ -95,12 +94,6 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
rules=
{
[{
required
:
true
,
message
:
l
(
'pages.rc.db.namePlaceholder'
)}]
}
>
rules=
{
[{
required
:
true
,
message
:
l
(
'pages.rc.db.namePlaceholder'
)}]
}
>
<
Input
placeholder=
{
l
(
'pages.rc.db.namePlaceholder'
)
}
/>
<
Input
placeholder=
{
l
(
'pages.rc.db.namePlaceholder'
)
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"alias"
label=
{
l
(
'pages.rc.db.alias'
)
}
>
<
Input
placeholder=
{
l
(
'pages.rc.db.aliasPlaceholder'
)
}
/>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"groupName"
name=
"groupName"
label=
{
l
(
'pages.rc.db.groupName'
)
}
label=
{
l
(
'pages.rc.db.groupName'
)
}
...
@@ -176,7 +169,6 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
...
@@ -176,7 +169,6 @@ const DataBaseForm: React.FC<ClickHouseFormProps> = (props) => {
initialValues=
{
{
initialValues=
{
{
id
:
formVals
.
id
,
id
:
formVals
.
id
,
name
:
formVals
.
name
,
name
:
formVals
.
name
,
alias
:
formVals
.
alias
,
type
:
formVals
.
type
,
type
:
formVals
.
type
,
groupName
:
formVals
.
groupName
,
groupName
:
formVals
.
groupName
,
url
:
formVals
.
url
,
url
:
formVals
.
url
,
...
...
dlink-web/src/pages/RegistrationCenter/DataBase/index.tsx
View file @
3114c400
...
@@ -142,14 +142,11 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
...
@@ -142,14 +142,11 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
]
}
]
}
>
>
<
Card
.
Meta
<
Card
.
Meta
title=
{
<
Tag
color=
"gray"
key=
{
row
.
alias
}
>
title=
{
<
Tag
color=
"gray"
key=
{
row
.
name
}
>
{
row
.
alias
}
{
row
.
name
}
</
Tag
>
}
</
Tag
>
}
description=
{
(
description=
{
(
<
Space
size=
{
0
}
>
<
Space
size=
{
0
}
>
<
Tag
key=
{
row
.
name
}
>
{
row
.
name
}
</
Tag
>
<
Tag
color=
"blue"
key=
{
row
.
groupName
}
>
<
Tag
color=
"blue"
key=
{
row
.
groupName
}
>
{
row
.
groupName
}
{
row
.
groupName
}
</
Tag
>
</
Tag
>
...
...
dlink-web/src/pages/RegistrationCenter/data.d.ts
View file @
3114c400
...
@@ -75,7 +75,6 @@ export type ClusterConfigurationTableListItem = {
...
@@ -75,7 +75,6 @@ export type ClusterConfigurationTableListItem = {
export
type
DataBaseItem
=
{
export
type
DataBaseItem
=
{
id
:
number
,
id
:
number
,
name
:
string
,
name
:
string
,
alias
:
string
,
groupName
:
string
,
groupName
:
string
,
type
:
string
,
type
:
string
,
url
:
string
,
url
:
string
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment