This is an automated email from the ASF dual-hosted git repository.
healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 9e6217278 [INLONG-4284][Dashboard] Modify ClickHouse sink parameters
(#4285)
9e6217278 is described below
commit 9e621727859b851c9d4e7781fd5531f49aa2e47c
Author: Daniel <[email protected]>
AuthorDate: Sat May 21 09:17:42 2022 +0800
[INLONG-4284][Dashboard] Modify ClickHouse sink parameters (#4285)
---
.../src/components/EditableTable/index.tsx | 2 +-
.../src/components/MetaData/StorageClickhouse.tsx | 75 +++++++++++++++++++++-
inlong-dashboard/src/locales/cn.json | 6 ++
inlong-dashboard/src/locales/en.json | 6 ++
4 files changed, 85 insertions(+), 4 deletions(-)
diff --git a/inlong-dashboard/src/components/EditableTable/index.tsx
b/inlong-dashboard/src/components/EditableTable/index.tsx
index 42f86d2ea..84b432160 100644
--- a/inlong-dashboard/src/components/EditableTable/index.tsx
+++ b/inlong-dashboard/src/components/EditableTable/index.tsx
@@ -41,7 +41,7 @@ export interface ColumnsItemProps {
dataIndex: string;
initialValue?: unknown;
width?: number;
- type?: 'text' | 'input' | 'inputnumber' | 'select';
+ type?: 'text' | 'input' | 'inputnumber' | 'select' | 'autocomplete';
// Props passed to form(input, select, ...)
props?:
| FormCompProps
diff --git a/inlong-dashboard/src/components/MetaData/StorageClickhouse.tsx
b/inlong-dashboard/src/components/MetaData/StorageClickhouse.tsx
index 36220fef7..0e929f1f7 100644
--- a/inlong-dashboard/src/components/MetaData/StorageClickhouse.tsx
+++ b/inlong-dashboard/src/components/MetaData/StorageClickhouse.tsx
@@ -24,7 +24,7 @@ import {
} from '@/utils/metaData';
import i18n from '@/i18n';
import { ColumnsType } from 'antd/es/table';
-import EditableTable from '@/components/EditableTable';
+import EditableTable, { ColumnsItemProps } from '@/components/EditableTable';
import { excludeObject } from '@/utils';
import { sourceDataFields } from './SourceDataFields';
@@ -203,7 +203,6 @@ const getForm: GetStorageFormFieldsType = (
disabled: isEdit && [110, 130].includes(currentValues?.status),
},
visible: values => values.isDistributed,
- _inTable: true,
},
{
name: 'partitionFields',
@@ -215,6 +214,40 @@ const getForm: GetStorageFormFieldsType = (
disabled: isEdit && [110, 130].includes(currentValues?.status),
},
},
+ {
+ name: 'engine',
+ type: 'input',
+ label:
i18n.t('components.AccessHelper.StorageMetaData.Clickhouse.Engine'),
+ initialValue: 'Log',
+ rules: [{ required: true }],
+ props: {
+ disabled: isEdit && [110, 130].includes(currentValues?.status),
+ },
+ },
+ {
+ name: 'orderBy',
+ type: 'input',
+ label:
i18n.t('components.AccessHelper.StorageMetaData.Clickhouse.OrderBy'),
+ props: {
+ disabled: isEdit && [110, 130].includes(currentValues?.status),
+ },
+ },
+ {
+ name: 'partitionBy',
+ type: 'input',
+ label:
i18n.t('components.AccessHelper.StorageMetaData.Clickhouse.PartitionBy'),
+ props: {
+ disabled: isEdit && [110, 130].includes(currentValues?.status),
+ },
+ },
+ {
+ name: 'primaryKey',
+ type: 'input',
+ label:
i18n.t('components.AccessHelper.StorageMetaData.Clickhouse.PrimaryKey'),
+ props: {
+ disabled: isEdit && [110, 130].includes(currentValues?.status),
+ },
+ },
{
name: 'fieldList',
type: EditableTable,
@@ -259,6 +292,42 @@ const getFieldListColumns: GetStorageColumnsType =
(dataType, currentValues) =>
}),
rules: [{ required: true }],
},
+ {
+ title: 'DefaultType',
+ dataIndex: 'defaultType',
+ type: 'autocomplete',
+ props: (text, record, idx, isNew) => ({
+ disabled: [110, 130].includes(currentValues?.status as number) &&
!isNew,
+ options: ['DEFAULT', 'EPHEMERAL', 'MATERIALIZED', 'ALIAS'].map(item =>
({
+ label: item,
+ value: item,
+ })),
+ }),
+ },
+ {
+ title: 'DefaultExpr',
+ dataIndex: 'defaultExpr',
+ type: 'input',
+ props: (text, record, idx, isNew) => ({
+ disabled: [110, 130].includes(currentValues?.status as number) &&
!isNew,
+ }),
+ visible: (text, record) =>
+ ['DEFAULT', 'EPHEMERAL', 'MATERIALIZED',
'ALIAS'].includes(record.defaultType as string),
+ },
+ {
+ title:
i18n.t('components.AccessHelper.StorageMetaData.Clickhouse.CompressionCode'),
+ dataIndex: 'compressionCode',
+ props: (text, record, idx, isNew) => ({
+ disabled: [110, 130].includes(currentValues?.status as number) &&
!isNew,
+ }),
+ },
+ {
+ title:
i18n.t('components.AccessHelper.StorageMetaData.Clickhouse.TtlExpr'),
+ dataIndex: 'ttlExpr',
+ props: (text, record, idx, isNew) => ({
+ disabled: [110, 130].includes(currentValues?.status as number) &&
!isNew,
+ }),
+ },
{
title: `ClickHouse${i18n.t(
'components.AccessHelper.StorageMetaData.Clickhouse.FieldDescription',
@@ -268,7 +337,7 @@ const getFieldListColumns: GetStorageColumnsType =
(dataType, currentValues) =>
disabled: [110, 130].includes(currentValues?.status as number) &&
!isNew,
}),
},
- ];
+ ] as ColumnsItemProps[];
};
const tableColumns = getForm('col') as ColumnsType;
diff --git a/inlong-dashboard/src/locales/cn.json
b/inlong-dashboard/src/locales/cn.json
index bd6ff71a0..eff1b37eb 100644
--- a/inlong-dashboard/src/locales/cn.json
+++ b/inlong-dashboard/src/locales/cn.json
@@ -81,6 +81,12 @@
"components.AccessHelper.StorageMetaData.Clickhouse.FieldNameRule":
"以英文字母开头,只能包含英文字母、数字、下划线",
"components.AccessHelper.StorageMetaData.Clickhouse.FieldType": "字段类型",
"components.AccessHelper.StorageMetaData.Clickhouse.FieldDescription":
"字段描述",
+ "components.AccessHelper.StorageMetaData.Clickhouse.Engine": "引擎",
+ "components.AccessHelper.StorageMetaData.Clickhouse.OrderBy": "排序",
+ "components.AccessHelper.StorageMetaData.Clickhouse.PartitionBy": "分区",
+ "components.AccessHelper.StorageMetaData.Clickhouse.PrimaryKey": "主键",
+ "components.AccessHelper.StorageMetaData.Clickhouse.CompressionCode": "压缩格式",
+ "components.AccessHelper.StorageMetaData.Clickhouse.TtlExpr": "生命周期",
"components.AccessHelper.StorageMetaData.Kafka.Server": "服务器地址",
"components.AccessHelper.StorageMetaData.Kafka.SerializationType": "序列化类型",
"components.AccessHelper.StorageMetaData.Kafka.PartitionNum": "Topic分区数",
diff --git a/inlong-dashboard/src/locales/en.json
b/inlong-dashboard/src/locales/en.json
index c61af47d4..62a7be1b9 100644
--- a/inlong-dashboard/src/locales/en.json
+++ b/inlong-dashboard/src/locales/en.json
@@ -81,6 +81,12 @@
"components.AccessHelper.StorageMetaData.Clickhouse.FieldNameRule": "At the
beginning of English letters, only English letters, numbers, and underscores",
"components.AccessHelper.StorageMetaData.Clickhouse.FieldType": "FieldType",
"components.AccessHelper.StorageMetaData.Clickhouse.FieldDescription":
"FieldDescription",
+ "components.AccessHelper.StorageMetaData.Clickhouse.Engine": "Engine",
+ "components.AccessHelper.StorageMetaData.Clickhouse.OrderBy": "OrderBy",
+ "components.AccessHelper.StorageMetaData.Clickhouse.PartitionBy":
"PartitionBy",
+ "components.AccessHelper.StorageMetaData.Clickhouse.PrimaryKey":
"PrimaryKey",
+ "components.AccessHelper.StorageMetaData.Clickhouse.CompressionCode":
"CompressionCode",
+ "components.AccessHelper.StorageMetaData.Clickhouse.TtlExpr": "TtlExpr",
"components.AccessHelper.StorageMetaData.Kafka.Server": "Server",
"components.AccessHelper.StorageMetaData.Kafka.SerializationType":
"SerializationType",
"components.AccessHelper.StorageMetaData.Kafka.PartitionNum": "PartitionNum",