Skip to content

Commit

Permalink
[Feature][scaleph-ui-react] update seatunnel dag web for scaleph-ui-r…
Browse files Browse the repository at this point in the history
…eact2 module (#685)

* feature: update seatunnel dag

* feature: update seatunnel dag

* feature: update seatunnel dag

* feature: update seatunnel dag

* feature: update seatunnel dag

* feature: update seatunnel connectors

* feature: update seatunnel connectors

* feature: update npm registry url

* feature: update npm registry url

* feature: update node and npm registry url

* feature: update node and npm registry url

---------

Co-authored-by: wangqi <wangqi@xinxuan.net>
  • Loading branch information
kalencaya and wangqi authored Jan 23, 2024
1 parent 8f2d5ba commit 34e6fbe
Show file tree
Hide file tree
Showing 80 changed files with 7,573 additions and 7,856 deletions.
4 changes: 2 additions & 2 deletions scaleph-ui-react/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
<nodeVersion>${build.node.version}</nodeVersion>
<npmVersion>${build.npm.version}</npmVersion>
<installDirectory>target</installDirectory>
<nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</nodeDownloadRoot>
<npmDownloadRoot>https://registry.npm.taobao.org/npm/-/</npmDownloadRoot>
<!-- <nodeDownloadRoot>http://npm.taobao.org/mirrors/node/</nodeDownloadRoot>-->
<!-- <npmDownloadRoot>https://registry.npmmirror.com/npm/-/</npmDownloadRoot>-->
</configuration>
</plugin>
</plugins>
Expand Down
6 changes: 3 additions & 3 deletions scaleph-ui-react2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@
<nodeVersion>${build.node.version}</nodeVersion>
<npmVersion>${build.npm.version}</npmVersion>
<installDirectory>target</installDirectory>
<nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</nodeDownloadRoot>
<npmDownloadRoot>https://registry.npm.taobao.org/npm/-/</npmDownloadRoot>
<!-- <nodeDownloadRoot>http://npm.taobao.org/mirrors/node/</nodeDownloadRoot>-->
<!-- <npmDownloadRoot>https://registry.npmmirror.com/npm/-/</npmDownloadRoot>-->
</configuration>
</plugin>
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@ const SeaTunnelConnectorDagNode = ({node}: { node: Node }) => {
setDrawerForm({visible: visible, data: node});
}}
onOK={(values) => {
// 移除 undefined 字段,否则会更新异常
const attrs: Record<string, any> = Object.keys(values)
.filter((key) => values[key] != null && values[key] != undefined)
.reduce((acc, key) => ({...acc, [key]: values[key]}), {});
node.setData({
...node.data,
label: values[STEP_ATTR_TYPE.stepTitle],
attrs: values
label: attrs[STEP_ATTR_TYPE.stepTitle],
attrs: attrs
})
setDrawerForm({visible: false, data: node});
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useEffect} from 'react';
import {Button, Drawer, Form} from 'antd';
import {Form} from 'antd';
import {
ProForm,
DrawerForm,
ProFormDigit,
ProFormGroup,
ProFormList,
Expand All @@ -16,7 +16,7 @@ import {CassandraParams, STEP_ATTR_TYPE} from '../constant';
import {StepSchemaService} from "@/pages/Project/Workspace/Artifact/DI/DiJobFlow/Dag/node/steps/helper";
import DataSourceItem from "@/pages/Project/Workspace/Artifact/DI/DiJobFlow/Dag/node/steps/dataSource";

const SinkCassandraStepForm: React.FC<ModalFormProps<Node>> = ({data, visible, onCancel, onOK}) => {
const SinkCassandraStepForm: React.FC<ModalFormProps<Node>> = ({data, visible, onVisibleChange, onOK}) => {
const intl = getIntl(getLocale());
const [form] = Form.useForm();

Expand All @@ -26,98 +26,95 @@ const SinkCassandraStepForm: React.FC<ModalFormProps<Node>> = ({data, visible, o

return (
<XFlow>
<Drawer
open={visible}
<DrawerForm
title={data.data.label}
form={form}
initialValues={data.data.attrs}
open={visible}
onOpenChange={onVisibleChange}
grid={true}
width={780}
bodyStyle={{overflowY: 'scroll'}}
destroyOnClose={true}
onClose={onCancel}
extra={
<Button
type="primary"
onClick={() => {
form.validateFields().then((values) => {
StepSchemaService.formatCassandraFields(values);
if (onOK) {
onOK(values);
}
});
}}
>
{intl.formatMessage({id: 'app.common.operate.confirm.label'})}
</Button>
}
drawerProps={{
styles: {body: {overflowY: 'scroll'}},
closeIcon: null,
destroyOnClose: true
}}
onFinish={(values) => {
if (onOK) {
StepSchemaService.formatCassandraFields(values);
onOK(values)
return Promise.resolve(true)
}
return Promise.resolve(false)
}}
>
<ProForm form={form} initialValues={data.data.attrs} grid={true} submitter={false}>
<ProFormText
name={STEP_ATTR_TYPE.stepTitle}
label={intl.formatMessage({id: 'pages.project.di.step.stepTitle'})}
rules={[{required: true}, {max: 120}]}
/>
<DataSourceItem dataSource={'Cassandra'}/>
<ProFormSelect
name={CassandraParams.consistencyLevel}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.consistencyLevel'})}
allowClear={false}
initialValue={'LOCAL_ONE'}
options={[
'ANY',
'ONE',
'TWO',
'THREE',
'QUORUM',
'ALL',
'LOCAL_ONE',
'LOCAL_QUORUM',
'EACH_QUORUM',
'SERIAL',
'LOCAL_SERIAL',
]}
/>
<ProFormText
name={CassandraParams.table}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.table'})}
rules={[{required: true}]}
/>
<ProFormSelect
name={CassandraParams.batchType}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.batchType'})}
allowClear={false}
initialValue={'UNLOGGED'}
options={['LOGGED', 'UNLOGGED', 'COUNTER']}
/>
<ProFormDigit
name={CassandraParams.batchSize}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.batchSize'})}
initialValue={5000}
fieldProps={{
step: 1000,
min: 0,
}}
/>
<ProFormSwitch
name={CassandraParams.asyncWrite}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.asyncWrite'})}
initialValue={true}
/>
<ProFormText
name={STEP_ATTR_TYPE.stepTitle}
label={intl.formatMessage({id: 'pages.project.di.step.stepTitle'})}
rules={[{required: true}, {max: 120}]}
/>
<DataSourceItem dataSource={'Cassandra'}/>
<ProFormSelect
name={CassandraParams.consistencyLevel}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.consistencyLevel'})}
allowClear={false}
initialValue={'LOCAL_ONE'}
options={[
'ANY',
'ONE',
'TWO',
'THREE',
'QUORUM',
'ALL',
'LOCAL_ONE',
'LOCAL_QUORUM',
'EACH_QUORUM',
'SERIAL',
'LOCAL_SERIAL',
]}
/>
<ProFormText
name={CassandraParams.table}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.table'})}
rules={[{required: true}]}
/>
<ProFormSelect
name={CassandraParams.batchType}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.batchType'})}
allowClear={false}
initialValue={'UNLOGGED'}
options={['LOGGED', 'UNLOGGED', 'COUNTER']}
/>
<ProFormDigit
name={CassandraParams.batchSize}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.batchSize'})}
initialValue={5000}
fieldProps={{
step: 1000,
min: 0,
}}
/>
<ProFormSwitch
name={CassandraParams.asyncWrite}
label={intl.formatMessage({id: 'pages.project.di.step.cassandra.asyncWrite'})}
initialValue={true}
/>

<ProFormGroup label={intl.formatMessage({id: 'pages.project.di.step.cassandra.fields'})}>
<ProFormList
name={CassandraParams.fieldArray}
copyIconProps={false}
creatorButtonProps={{
creatorButtonText: intl.formatMessage({
id: 'pages.project.di.step.cassandra.fields.field',
}),
type: 'text',
}}
>
<ProFormText name={CassandraParams.field}/>
</ProFormList>
</ProFormGroup>
</ProForm>
</Drawer>
<ProFormGroup label={intl.formatMessage({id: 'pages.project.di.step.cassandra.fields'})}>
<ProFormList
name={CassandraParams.fieldArray}
copyIconProps={false}
creatorButtonProps={{
creatorButtonText: intl.formatMessage({
id: 'pages.project.di.step.cassandra.fields.field',
}),
type: 'text',
}}
>
<ProFormText name={CassandraParams.field}/>
</ProFormList>
</ProFormGroup>
</DrawerForm>
</XFlow>
);
};
Expand Down
Loading

0 comments on commit 34e6fbe

Please sign in to comment.