Browse Source

(*)适配器配置 增加 任务配置

master
peng.peng 2 years ago
parent
commit
0dd40bad26
  1. 2
      web/client/src/sections/metadataAcquisition/actions/dataSource.js
  2. 5
      web/client/src/sections/metadataAcquisition/components/adapterStep.js
  3. 1
      web/client/src/sections/metadataAcquisition/containers/acquisitionTask.js
  4. 24
      web/client/src/sections/metadataAcquisition/containers/adapter.js
  5. 2
      web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js

2
web/client/src/sections/metadataAcquisition/actions/dataSource.js

@ -11,7 +11,7 @@ export function addDataSource(params, msg) {
actionType: 'ADD_DATSOURCE', actionType: 'ADD_DATSOURCE',
url: ApiTable.addDataSource, url: ApiTable.addDataSource,
msg: { msg: {
option: msg || '新增数据源', option: msg == '' ? '' : '新增数据源',
}, },
}); });
} }

5
web/client/src/sections/metadataAcquisition/components/adapterStep.js

@ -31,7 +31,8 @@ const AdapterStep = (props) => {
const onFinish = (values) => { const onFinish = (values) => {
props.onFinish({ props.onFinish({
stepOneValues, stepOneValues,
stepTwoValues: values || stepTwoValues stepTwoValues: current == 2 ? values || stepTwoValues : stepTwoValues,
stepThreeValue: values
}) })
} }
@ -65,7 +66,7 @@ const AdapterStep = (props) => {
})); }));
return <> return <>
{stepProps == 3 && <Steps current={current} items={items} />} {stepProps == 3 && <Steps style={{ marginBottom: 10 }} current={current} items={items} />}
<div className="steps-content">{steps[current].content}</div> <div className="steps-content">{steps[current].content}</div>
</> </>
} }

1
web/client/src/sections/metadataAcquisition/containers/acquisitionTask.js

@ -116,6 +116,7 @@ function AcquisitionTask(props) {
dataSourceId: values?.dataSourceId, dataSourceId: values?.dataSourceId,
cron: values?.cron, cron: values?.cron,
} }
if (editData) { if (editData) {
dispatch(actions.metadataAcquisition.modifyTask(editData?.id, dataToSave)).then(res => { dispatch(actions.metadataAcquisition.modifyTask(editData?.id, dataToSave)).then(res => {
if (res.success) { if (res.success) {

24
web/client/src/sections/metadataAcquisition/containers/adapter.js

@ -34,19 +34,37 @@ const LatestMetadata = (props) => {
]; ];
const onFinish = (values) => { const onFinish = (values) => {
const { stepOneValues, stepTwoValues } = values; const { stepOneValues, stepTwoValues, stepThreeValue } = values;
const adapterInfo = adapters?.find(x => x.adapterName == stepOneValues?.adapterName) const adapterInfo = adapters?.find(x => x.adapterName == stepOneValues?.adapterName)
if (adapterInfo) { if (adapterInfo) {
dispatch(actions.metadataAcquisition.addDataSource({ dispatch(actions.metadataAcquisition.addDataSource({
name: stepOneValues?.name, name: stepOneValues?.name,
audited: true, audited: true,
adapter: adapterInfo?.id, adapterId: adapterInfo?.id,
mountPath: 1, mountPath: 1,
description: stepOneValues?.description, description: stepOneValues?.description,
config: stepTwoValues, config: stepTwoValues,
time: moment() time: moment()
})).then(res => { }, '')).then(res => {
if (res.success) {
const dataToSave = {
taskName: stepThreeValue?.taskName,
retryCount: stepThreeValue?.retryCount,
retryTime: stepThreeValue?.retryTime,
retried: stepThreeValue?.retried ? true : false,
dataSourceId: res?.payload?.data?.id,
cron: stepThreeValue?.cron,
}
dataToSave.enabled = true;
dataToSave.autoReleased = true;
dataToSave.storageStrategy = "增量";
dispatch(actions.metadataAcquisition.addTask(dataToSave, '适配器配置')).then(res => {
if (res.success) {
setIsModalOpen(false) setIsModalOpen(false)
}
})
}
}) })
} }
} }

2
web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js

@ -108,7 +108,7 @@ function DataSourceManagement(props) {
]; ];
const onFinish = (values) => { const onFinish = (values) => {
const { stepOneValues, stepTwoValues } = values; const { stepOneValues, stepTwoValues, } = values;
const adapterInfo = adapters?.find(x => x.adapterName == stepOneValues?.adapterName) const adapterInfo = adapters?.find(x => x.adapterName == stepOneValues?.adapterName)
if (adapterInfo) { if (adapterInfo) {
const dataToSave = { const dataToSave = {

Loading…
Cancel
Save