Commit 65a92cb2 by zhaochengxiang

JDBC信息

parent 8ef1ad7d
{
"impala": {
"url": "",
"downloadUrl": ""
},
"hana": {
"url": "",
"downloadUrl": ""
}
}
\ No newline at end of file
......@@ -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
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
......@@ -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
}
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
......@@ -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>
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment