Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
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
zhaowei
dlink
Commits
9c06fc27
Unverified
Commit
9c06fc27
authored
Jun 01, 2022
by
aiwenmo
Committed by
GitHub
Jun 01, 2022
Browse files
Options
Browse Files
Download
Plain Diff
[Feature-558][web] add delete button of database Manage
[Feature-558][web] add delete button of database Manage
parents
9e9b1fe3
c2c1297e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
index.tsx
dlink-web/src/pages/DataBase/index.tsx
+27
-4
No files found.
dlink-web/src/pages/DataBase/index.tsx
View file @
9c06fc27
...
@@ -9,11 +9,11 @@ import {
...
@@ -9,11 +9,11 @@ import {
EditOutlined
,
EditOutlined
,
EllipsisOutlined
,
EllipsisOutlined
,
CheckCircleOutlined
,
CheckCircleOutlined
,
ExclamationCircleOutlined
ExclamationCircleOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
}
from
'@ant-design/icons'
;
import
{
Progress
,
Tag
,
Button
,
Space
,
Badge
,
Typography
,
Image
,
Row
,
Col
,
Card
,
Avatar
}
from
'antd'
;
import
{
Progress
,
Tag
,
Button
,
Space
,
Badge
,
Typography
,
Image
,
Row
,
Col
,
Card
,
Avatar
,
Modal
}
from
'antd'
;
import
ProList
from
'@ant-design/pro-list'
;
import
ProList
from
'@ant-design/pro-list'
;
import
{
queryData
}
from
"@/components/Common/crud"
;
import
{
handleRemove
,
queryData
}
from
"@/components/Common/crud"
;
import
{
getDBImage
}
from
"@/pages/DataBase/DB"
;
import
{
getDBImage
}
from
"@/pages/DataBase/DB"
;
import
DBForm
from
"./components/DBForm"
;
import
DBForm
from
"./components/DBForm"
;
import
{
ActionType
}
from
"@ant-design/pro-table"
;
import
{
ActionType
}
from
"@ant-design/pro-table"
;
...
@@ -21,6 +21,7 @@ import {ActionType} from "@ant-design/pro-table";
...
@@ -21,6 +21,7 @@ import {ActionType} from "@ant-design/pro-table";
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
{
DataBaseItem
}
from
"@/pages/DataBase/data"
;
import
{
DataBaseItem
}
from
"@/pages/DataBase/data"
;
import
{
checkHeartBeat
}
from
"@/pages/DataBase/service"
;
import
{
checkHeartBeat
}
from
"@/pages/DataBase/service"
;
import
{
showDataBase
}
from
"@/components/Studio/StudioEvent/DDL"
;
const
{
Text
}
=
Typography
;
const
{
Text
}
=
Typography
;
...
@@ -32,11 +33,16 @@ const cardBodyStyle = {
...
@@ -32,11 +33,16 @@ const cardBodyStyle = {
};
};
const
DataBaseTableList
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
DataBaseTableList
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
{
dispatch
}
=
props
;
const
[
chooseDBModalVisible
,
handleDBFormModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
chooseDBModalVisible
,
handleDBFormModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
values
,
setValues
]
=
useState
<
any
>
({});
const
[
values
,
setValues
]
=
useState
<
any
>
({});
const
actionRef
=
useRef
<
ActionType
>
();
const
actionRef
=
useRef
<
ActionType
>
();
const
onRefreshDataBase
=
()
=>
{
showDataBase
(
dispatch
);
};
const
onEdit
=
(
row
:
DataBaseItem
)
=>
{
const
onEdit
=
(
row
:
DataBaseItem
)
=>
{
setValues
(
row
);
setValues
(
row
);
handleDBFormModalVisible
(
true
);
handleDBFormModalVisible
(
true
);
...
@@ -47,6 +53,20 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
...
@@ -47,6 +53,20 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
actionRef
.
current
?.
reloadAndRest
?.();
actionRef
.
current
?.
reloadAndRest
?.();
};
};
const
onDeleteDataBase
=
(
row
:
DataBaseItem
)
=>
{
Modal
.
confirm
({
title
:
'删除数据源'
,
content
:
`确定删除该数据源【
${
row
.
alias
===
""
?
row
.
name
:
row
.
alias
}
】吗?`
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
await
handleRemove
(
'api/database'
,
[
row
]);
onRefreshDataBase
();
actionRef
.
current
?.
reloadAndRest
?.();
}
});
};
return
(
return
(
<
PageContainer
>
<
PageContainer
>
<
ProList
<
ProList
...
@@ -90,6 +110,9 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
...
@@ -90,6 +110,9 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
<
EditOutlined
key=
"edit"
onClick=
{
()
=>
{
<
EditOutlined
key=
"edit"
onClick=
{
()
=>
{
onEdit
(
row
);
onEdit
(
row
);
}
}
/>,
}
}
/>,
<
DeleteOutlined
key=
"delete"
onClick=
{
()
=>
{
onDeleteDataBase
(
row
);
}
}
/>,
<
EllipsisOutlined
key=
"ellipsis"
/>,
<
EllipsisOutlined
key=
"ellipsis"
/>,
]
}
]
}
>
>
...
...
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