|
|
@ -7,26 +7,30 @@ import AdapterStep from '../components/adapterStep'; |
|
|
|
//关系型数据库卡片配置
|
|
|
|
const RELATION_DATABASE_TOOL_CONFIG = [{ |
|
|
|
key: 'postgre', // key与详情配置(adapterDetail)中的key需一直否则无法查看详情页
|
|
|
|
name: 'PostgreSQL数据库', |
|
|
|
version: '9.X', |
|
|
|
desc: '采集数据数据库结构及相关对象', |
|
|
|
title: 'PostgreSQL采集适配器' |
|
|
|
name: 'PostgreSQL采集适配器', |
|
|
|
}] |
|
|
|
|
|
|
|
const LatestMetadata = (props) => { |
|
|
|
const { history, actions, dispatch } = props; |
|
|
|
const { history, actions, dispatch, adapters } = props; |
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
dispatch(actions.metadataAcquisition.getAdapters()) |
|
|
|
}, []) |
|
|
|
|
|
|
|
const renderRelationalDatabase = () => { |
|
|
|
return RELATION_DATABASE_TOOL_CONFIG.map(s => <Card |
|
|
|
title={<a onClick={() => { history.push(`/metadataAcquisition/adapter/detail/${s.key}`) }}>{s.title}</a>} |
|
|
|
extra={<a onClick={() => { setIsModalOpen(s.key) }}><DatabaseOutlined style={{ fontSize: 18 }} /></a>} |
|
|
|
style={{ width: '30%', lineHeight: '30px' }} |
|
|
|
> |
|
|
|
<p>工具名称:{s.name}</p> |
|
|
|
<p>工具版本:{s.version}</p> |
|
|
|
<p>描述:{s.desc}</p> |
|
|
|
</Card>) |
|
|
|
return RELATION_DATABASE_TOOL_CONFIG.map(s => { |
|
|
|
const adapterInfo = adapters?.find(x => x.adapterName == s.name) |
|
|
|
return <Card |
|
|
|
title={<a onClick={() => { history.push(`/metadataAcquisition/adapter/detail/${s.key}`) }}>{adapterInfo?.adapterName}</a>} |
|
|
|
extra={<a onClick={() => { setIsModalOpen(s.key) }}><DatabaseOutlined style={{ fontSize: 18 }} /></a>} |
|
|
|
style={{ width: '30%', lineHeight: '30px' }} |
|
|
|
> |
|
|
|
<p>工具名称:{adapterInfo?.toolName}</p> |
|
|
|
<p>工具版本:{adapterInfo?.adapterVersion}</p> |
|
|
|
<p>描述:{adapterInfo?.description}</p> |
|
|
|
</Card> |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const items = [ |
|
|
@ -65,11 +69,12 @@ const LatestMetadata = (props) => { |
|
|
|
} |
|
|
|
|
|
|
|
function mapStateToProps(state) { |
|
|
|
const { global, auth } = state; |
|
|
|
const { global, auth, adapters } = state; |
|
|
|
return { |
|
|
|
clientHeight: global.clientHeight, |
|
|
|
user: auth.user, |
|
|
|
actions: global.actions, |
|
|
|
adapters: adapters?.data || [] |
|
|
|
}; |
|
|
|
} |
|
|
|
export default connect(mapStateToProps)(LatestMetadata) |