diff --git a/scripts/0.0.3/data/01.insert_t_adapter.sql b/scripts/0.0.3/data/01.insert_t_adapter.sql new file mode 100644 index 0000000..ea6dae3 --- /dev/null +++ b/scripts/0.0.3/data/01.insert_t_adapter.sql @@ -0,0 +1 @@ +insert into t_adapter(adapter_name, adapter_version, tool_name, description, config) values ('PostgreSQL采集适配器','9.X','PostgreSQL数据库','采集数据数据库结构及相关对象','{"param":"参数名","title":"标题","value":"参数值","description":"描述"}'); \ No newline at end of file diff --git a/web/client/src/sections/metadataAcquisition/actions/adapter.js b/web/client/src/sections/metadataAcquisition/actions/adapter.js index 7d2a509..8dfe530 100644 --- a/web/client/src/sections/metadataAcquisition/actions/adapter.js +++ b/web/client/src/sections/metadataAcquisition/actions/adapter.js @@ -29,3 +29,16 @@ export function addAdapter(params) { }); } +export function getAdapters(query) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + query: query || {}, + actionType: 'GET_ACQ_ADAPTERS', + url: `${ApiTable.getAdapters}`, + msg: { error: '获取适配器列表失败' }, + reducer: { name: 'adapters' } + }); +} + + diff --git a/web/client/src/sections/metadataAcquisition/components/details/postgreDetail.js b/web/client/src/sections/metadataAcquisition/components/details/postgreDetail.js index 1b00af7..6402fdb 100644 --- a/web/client/src/sections/metadataAcquisition/components/details/postgreDetail.js +++ b/web/client/src/sections/metadataAcquisition/components/details/postgreDetail.js @@ -17,10 +17,22 @@ const PostGreDetail = (props) => { const renderManageInfo = () => { const dataSource = [ { - param: 'url', - title: '数据库访问URL', + param: 'host', + title: '数据库访问host', isRequired: 'true', - description: '数据库访问所需的URL', + description: '数据库访问所需的host', + }, + { + param: 'port', + title: '数据库访问port', + isRequired: 'true', + description: '数据库访问所需的port', + }, + { + param: 'database', + title: '数据库名称', + isRequired: 'true', + description: '数据库名称', }, { param: 'username', diff --git a/web/client/src/sections/metadataAcquisition/containers/adapter.js b/web/client/src/sections/metadataAcquisition/containers/adapter.js index 20ab361..453ff5c 100644 --- a/web/client/src/sections/metadataAcquisition/containers/adapter.js +++ b/web/client/src/sections/metadataAcquisition/containers/adapter.js @@ -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 => { history.push(`/metadataAcquisition/adapter/detail/${s.key}`) }}>{s.title}} - extra={ { setIsModalOpen(s.key) }}>} - style={{ width: '30%', lineHeight: '30px' }} - > -

工具名称:{s.name}

-

工具版本:{s.version}

-

描述:{s.desc}

-
) + return RELATION_DATABASE_TOOL_CONFIG.map(s => { + const adapterInfo = adapters?.find(x => x.adapterName == s.name) + return { history.push(`/metadataAcquisition/adapter/detail/${s.key}`) }}>{adapterInfo?.adapterName}} + extra={ { setIsModalOpen(s.key) }}>} + style={{ width: '30%', lineHeight: '30px' }} + > +

工具名称:{adapterInfo?.toolName}

+

工具版本:{adapterInfo?.adapterVersion}

+

描述:{adapterInfo?.description}

+
+ }) } 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) \ No newline at end of file diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 1771317..d3dcd1d 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -21,7 +21,7 @@ export const ApiTable = { //元数据采集 pgCheckConnect: 'adapter/check/connect', addDataSource: 'meta/acq/dataSource', - + getAdapters: 'meta/acq/adapters', }; export const RouteTable = {