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. 26
      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',
url: ApiTable.addDataSource,
msg: {
option: msg || '新增数据源',
option: msg == '' ? '' : '新增数据源',
},
});
}

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

@ -31,7 +31,8 @@ const AdapterStep = (props) => {
const onFinish = (values) => {
props.onFinish({
stepOneValues,
stepTwoValues: values || stepTwoValues
stepTwoValues: current == 2 ? values || stepTwoValues : stepTwoValues,
stepThreeValue: values
})
}
@ -65,7 +66,7 @@ const AdapterStep = (props) => {
}));
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>
</>
}

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

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

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

@ -34,19 +34,37 @@ const LatestMetadata = (props) => {
];
const onFinish = (values) => {
const { stepOneValues, stepTwoValues } = values;
const { stepOneValues, stepTwoValues, stepThreeValue } = values;
const adapterInfo = adapters?.find(x => x.adapterName == stepOneValues?.adapterName)
if (adapterInfo) {
dispatch(actions.metadataAcquisition.addDataSource({
name: stepOneValues?.name,
audited: true,
adapter: adapterInfo?.id,
adapterId: adapterInfo?.id,
mountPath: 1,
description: stepOneValues?.description,
config: stepTwoValues,
time: moment()
})).then(res => {
setIsModalOpen(false)
}, '')).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)
}
})
}
})
}
}

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

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

Loading…
Cancel
Save