Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
b7084f23
Commit
b7084f23
authored
Jul 05, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订阅
parent
6e3251fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
+52
-3
pds.js
src/model/pds.js
+5
-0
pds.js
src/service/pds.js
+6
-1
index.jsx
src/view/Manage/Model/index.jsx
+41
-2
No files found.
src/model/pds.js
View file @
b7084f23
...
...
@@ -135,4 +135,8 @@ export function* getAttrs(payload) {
export
function
*
getJdbcInformation
()
{
return
yield
call
(
pds
.
getJdbcInformation
);
}
export
function
*
subscribe
(
payload
)
{
return
yield
call
(
pds
.
subscribe
,
payload
);
}
\ No newline at end of file
src/service/pds.js
View file @
b7084f23
import
{
PostFile
,
GetJSON
,
PostJSON
,
Post
,
Get
,
GetJSONRaw
}
from
"../util/axios"
import
{
PostFile
,
GetJSON
,
PostJSON
,
Post
,
Get
,
GetJSONRaw
,
callFetchRaw
}
from
"../util/axios"
import
{
ContextPath
}
from
"../util"
;
export
function
refreshCatalog
()
{
...
...
@@ -135,4 +135,8 @@ export function getAttrs(payload) {
export
function
getJdbcInformation
()
{
return
GetJSONRaw
(
`
${
ContextPath
}
/json/jdbc.json`
);
}
export
function
subscribe
(
payload
)
{
return
callFetchRaw
(
'post'
,
'/pdataservice/pdsSub/subscribeMsg'
,
payload
)
}
\ No newline at end of file
src/view/Manage/Model/index.jsx
View file @
b7084f23
import
React
from
'react'
;
import
{
Button
,
Space
,
Spin
,
Input
,
Select
,
Tooltip
,
Dropdown
,
Menu
}
from
'antd'
;
import
{
Button
,
Space
,
Spin
,
Input
,
Select
,
Tooltip
,
Dropdown
,
Menu
,
Modal
}
from
'antd'
;
import
copy
from
"copy-to-clipboard"
;
import
{
CaretLeftOutlined
,
CaretRightOutlined
}
from
'@ant-design/icons'
;
import
{
ResizableBox
}
from
'react-resizable'
;
...
...
@@ -346,6 +346,34 @@ class Model extends React.Component {
this.setState({ startReleaseVisible: true })
}
onSubscribeBtnClick = () => {
const { selectModelerIds } = this.state;
const { modal } = this.props;
if ((selectModelerIds||[]).length === 0) {
showMessage('info', '请先选择服务');
return;
}
modal?.confirm({
title: '提示',
content: '是否确认订阅选中服务?',
onOk: () => {
dispatch({
type: 'pds.subscribe',
payload: {
params: {
ids: (selectModelerIds||[]).join(','),
}
},
callback: () => {
showMessage('success', '订阅成功');
this.setState({ selectModelerIds: [] });
}
})
},
});
}
onOfflineBtnClick = () => {
const { selectModelerIds } = this.state;
if ((selectModelerIds||[]).length === 0) {
...
...
@@ -691,6 +719,12 @@ class Model extends React.Component {
<Button onClick={() => { this.setState({jdbcInformationVisible: true}); }}>JDBC信息</Button>
</Space>
{
(getDataModelerRole(app?.user)!==DataModelerRoleReader) && isOnlyEnding &&
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择服务':''}>
<Button onClick={this.onSubscribeBtnClick} disabled={(selectModelerIds||[]).length===0}>订阅</Button>
</Tooltip>
}
{
currentView==='dir' && (getDataModelerRole(app?.user)!==DataModelerRoleReader) && isOnlyEnding &&
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择服务':''}>
<Button onClick={this.onOfflineBtnClick} disabled={(selectModelerIds||[]).length===0}>下线</Button>
...
...
@@ -818,10 +852,15 @@ class Model extends React.Component {
}
const WrapModel = (props) => {
const [modal, contextHolder] = Modal.useModal();
return (
<AppContext.Consumer>
{
value => <Model app={value} {...props} />
value => <React.Fragment>
<Model app={value} modal={modal} {...props} />
{contextHolder}
</React.Fragment>
}
</AppContext.Consumer>
)
...
...
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