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
65a92cb2
Commit
65a92cb2
authored
Jun 21, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JDBC信息
parent
8ef1ad7d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
3 deletions
+138
-3
jdbc.json
public/json/jdbc.json
+11
-0
pds.js
src/model/pds.js
+5
-0
pds.js
src/service/pds.js
+7
-1
axios.js
src/util/axios.js
+24
-2
JDBCInformation.jsx
src/view/Manage/Model/Component/JDBCInformation.jsx
+81
-0
index.jsx
src/view/Manage/Model/index.jsx
+10
-0
No files found.
public/json/jdbc.json
0 → 100644
View file @
65a92cb2
{
"impala"
:
{
"url"
:
""
,
"downloadUrl"
:
""
},
"hana"
:
{
"url"
:
""
,
"downloadUrl"
:
""
}
}
\ No newline at end of file
src/model/pds.js
View file @
65a92cb2
...
...
@@ -131,4 +131,8 @@ export function* getCols(payload) {
export
function
*
getAttrs
(
payload
)
{
return
yield
call
(
pds
.
getAttrs
,
payload
);
}
export
function
*
getJdbcInformation
()
{
return
yield
call
(
pds
.
getJdbcInformation
);
}
\ No newline at end of file
src/service/pds.js
View file @
65a92cb2
import
{
PostFile
,
GetJSON
,
PostJSON
,
Post
,
Get
}
from
"../util/axios"
import
{
PostFile
,
GetJSON
,
PostJSON
,
Post
,
Get
,
GetJSONRaw
}
from
"../util/axios"
import
{
ContextPath
}
from
"../util"
;
export
function
refreshCatalog
()
{
return
GetJSON
(
"/pdataservice/pdsCURD/refreshDataServiceCatalog"
)
...
...
@@ -130,4 +131,8 @@ export function getCols(payload) {
export
function
getAttrs
(
payload
)
{
return
GetJSON
(
"/pdataservice/pdsModel/attrs"
,
payload
);
}
export
function
getJdbcInformation
()
{
return
GetJSONRaw
(
`
${
ContextPath
}
/json/jdbc.json`
);
}
\ No newline at end of file
src/util/axios.js
View file @
65a92cb2
...
...
@@ -20,6 +20,19 @@ const instance = axios.create({
}
});
const
instanceRow
=
axios
.
create
({
baseURL
:
''
,
timeout
:
40000
,
headers
:
{
//'X-Custom-Header': 'rest',
'Cache-Control'
:
'no-cache,no-store,must-revalidate,max-age=-1,private'
},
responseType
:
'json'
,
// default
validateStatus
:
(
status
)
=>
{
return
true
;
}
});
const
textplain
=
axios
.
create
({
baseURL
,
timeout
:
40000
,
...
...
@@ -119,6 +132,16 @@ export function GetJSON(url, params) {
)
}
export
const
GetJSONRaw
=
(
url
,
params
)
=>
{
const
cancelToken
=
__source
?
__source
.
token
:
null
;
return
instanceRow
.
get
(
url
,
{
params
,
cancelToken
,
validateStatus
:
false
}).
then
(
callback
)
}
export
function
Delete
(
url
,
params
)
{
const
cancelToken
=
__source
?
__source
.
token
:
null
;
return
instance
.
delete
(
url
,
{
...
...
@@ -187,4 +210,4 @@ export const callFetchRaw = (method, url, options) => {
...
config
,
...
reqConfig
})
}
\ No newline at end of file
}
src/view/Manage/Model/Component/JDBCInformation.jsx
0 → 100644
View file @
65a92cb2
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Modal
,
Typography
,
Button
,
Space
}
from
'antd'
;
import
{
CopyOutlined
,
DownloadOutlined
}
from
'@ant-design/icons'
;
import
copy
from
'copy-to-clipboard'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
const
FC
=
(
props
)
=>
{
const
{
visible
,
onCancel
}
=
props
;
const
[
information
,
setInformation
]
=
useState
(
undefined
);
useEffect
(()
=>
{
if
(
visible
)
{
getInformation
();
}
},
[
visible
])
const
getInformation
=
()
=>
{
dispatch
({
type
:
'pds.getJdbcInformation'
,
callback
:
data
=>
{
setInformation
(
data
);
}
})
}
return
(
<
Modal
title=
'JDBC信息'
width=
{
540
}
visible=
{
visible
}
onCancel=
{
onCancel
}
footer=
{
null
}
>
<
div
className=
'flex mb-3'
style=
{
{
justifyContent
:
'space-between'
,
alignItems
:
'baseline'
}
}
>
<
div
style=
{
{
width
:
400
}
}
>
<
Typography
.
Text
>
{
`impala JDBC地址: ${information?.impala?.url}`
}
</
Typography
.
Text
>
</
div
>
<
Space
>
<
Button
type=
'text'
icon=
{
<
CopyOutlined
/>
}
onClick=
{
()
=>
{
if
(
information
?.
impala
?.
url
)
{
copy
(
information
?.
impala
?.
url
);
showMessage
(
'success'
,
'复制成功'
);
}
}
}
/>
<
Button
type=
'text'
icon=
{
<
DownloadOutlined
/>
}
onClick=
{
()
=>
{
if
(
information
?.
impala
?.
downloadUrl
)
{
window
.
open
(
information
?.
impala
?.
downloadUrl
);
}
}
}
/>
</
Space
>
</
div
>
<
div
className=
'flex'
style=
{
{
justifyContent
:
'space-between'
,
alignItems
:
'baseline'
}
}
>
<
div
style=
{
{
width
:
400
}
}
>
<
Typography
.
Text
>
{
`Hana JDBC地址: ${information?.hana?.url}`
}
</
Typography
.
Text
>
</
div
>
<
Space
>
<
Button
type=
'text'
icon=
{
<
CopyOutlined
/>
}
onClick=
{
()
=>
{
if
(
information
?.
hana
?.
url
)
{
copy
(
information
?.
hana
?.
url
);
showMessage
(
'success'
,
'复制成功'
);
}
}
}
/>
<
Button
type=
'text'
icon=
{
<
DownloadOutlined
/>
}
onClick=
{
()
=>
{
if
(
information
?.
hana
?.
downloadUrl
)
{
window
.
open
(
information
?.
hana
?.
downloadUrl
);
}
}
}
/>
</
Space
>
</
div
>
</
Modal
>
)
}
export
default
FC
;
\ No newline at end of file
src/view/Manage/Model/index.jsx
View file @
65a92cb2
...
...
@@ -14,6 +14,7 @@ import ExportOtherModal from './Component/ExportOtherModal';
import
RecatalogModal
from
'./Component/RecatalogModal'
;
import
HistoryAndVersionDrawer
from
'./Component/HistoryAndVersionDrawer'
;
import
StartFlowModal
from
'./Component/StartFlowModal'
;
import
JDBCInformation
from
'./Component/JDBCInformation'
;
import
{
showMessage
,
showNotifaction
,
inputWidth
,
DeleteTipModal
,
getDataModelerRole
}
from
'../../../util'
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../model'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
Holder
,
DDL
,
DataModelerRoleReader
,
ReadOnly
}
from
'../../../util/constant'
;
...
...
@@ -69,6 +70,7 @@ class Model extends React.Component {
},
startReleaseVisible
:
false
,
offlineVisible
:
false
,
jdbcInformationVisible
:
false
,
}
}
...
...
@@ -685,6 +687,9 @@ class Model extends React.Component {
<Space>
<Button onClick={this.onVisibleColSettingClick}>可见列设置</Button>
</Space>
<Space>
<Button onClick={() => { this.setState({jdbcInformationVisible: true}); }}>JDBC信息</Button>
</Space>
{
currentView==='dir' && (getDataModelerRole(app?.user)!==DataModelerRoleReader) && isOnlyEnding &&
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择服务':''}>
...
...
@@ -801,6 +806,11 @@ class Model extends React.Component {
visible={colSettingModalVisible}
onCancel={this.onColSettingModalCancel}
/>
<JDBCInformation
visible={this.state.jdbcInformationVisible}
onCancel={() => { this.setState({ jdbcInformationVisible: false }) }}
/>
</div>
);
}
...
...
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