From 37bdbc423e02c079681e08dbba8dec8917f3104e Mon Sep 17 00:00:00 2001 From: wanglz Date: Tue, 27 Feb 2024 14:28:20 +0800 Subject: [PATCH] [INLONG-9729][Dashboard] Data access sink field mapping supports underscores --- .../src/plugins/sinks/defaults/ClickHouse.ts | 2 +- .../src/plugins/sinks/defaults/Cls.ts | 2 +- .../src/plugins/sinks/defaults/Doris.ts | 2 +- .../plugins/sinks/defaults/Elasticsearch.ts | 2 +- .../src/plugins/sinks/defaults/Greenplum.ts | 2 +- .../src/plugins/sinks/defaults/HBase.ts | 2 +- .../src/plugins/sinks/defaults/Hive.ts | 2 +- .../src/plugins/sinks/defaults/MySQL.ts | 2 +- .../src/plugins/sinks/defaults/Oracle.ts | 2 +- .../src/plugins/sinks/defaults/PostgreSQL.ts | 2 +- .../src/plugins/sinks/defaults/Redis.ts | 2 +- .../src/plugins/sinks/defaults/SQLServer.ts | 2 +- .../src/plugins/sinks/defaults/StarRocks.ts | 2 +- .../plugins/sinks/defaults/TDSQLPostgreSQL.ts | 2 +- .../src/plugins/sources/defaults/File.ts | 24 +------------------ inlong-dashboard/src/ui/locales/cn.json | 1 - inlong-dashboard/src/ui/locales/en.json | 1 - 17 files changed, 15 insertions(+), 39 deletions(-) diff --git a/inlong-dashboard/src/plugins/sinks/defaults/ClickHouse.ts b/inlong-dashboard/src/plugins/sinks/defaults/ClickHouse.ts index 1c7a3ed1244..147f9cc2ed4 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/ClickHouse.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/ClickHouse.ts @@ -404,7 +404,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/, + pattern: /^[_a-zA-Z][a-zA-Z0-9_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Cls.ts b/inlong-dashboard/src/plugins/sinks/defaults/Cls.ts index 20259932266..397efb0d977 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/Cls.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/Cls.ts @@ -142,7 +142,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Doris.ts b/inlong-dashboard/src/plugins/sinks/defaults/Doris.ts index c4f2d164a44..780dee47aff 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/Doris.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/Doris.ts @@ -280,7 +280,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Elasticsearch.ts b/inlong-dashboard/src/plugins/sinks/defaults/Elasticsearch.ts index 71d0dfa65c0..3a9871669c2 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/Elasticsearch.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/Elasticsearch.ts @@ -137,7 +137,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/, + pattern: /^[_a-zA-Z][a-zA-Z0-9_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Greenplum.ts b/inlong-dashboard/src/plugins/sinks/defaults/Greenplum.ts index 9debfcb4fa5..bb1c8bbc8ef 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/Greenplum.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/Greenplum.ts @@ -203,7 +203,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/HBase.ts b/inlong-dashboard/src/plugins/sinks/defaults/HBase.ts index 52bd9242e72..4d07bbe0a7f 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/HBase.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/HBase.ts @@ -180,7 +180,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Hive.ts b/inlong-dashboard/src/plugins/sinks/defaults/Hive.ts index a09c4899fa8..d58e436b7c4 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/Hive.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/Hive.ts @@ -349,7 +349,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/MySQL.ts b/inlong-dashboard/src/plugins/sinks/defaults/MySQL.ts index d81dc52de74..38e9517153a 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/MySQL.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/MySQL.ts @@ -187,7 +187,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Oracle.ts b/inlong-dashboard/src/plugins/sinks/defaults/Oracle.ts index 9f4808bed36..f070513d5b1 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/Oracle.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/Oracle.ts @@ -196,7 +196,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/PostgreSQL.ts b/inlong-dashboard/src/plugins/sinks/defaults/PostgreSQL.ts index 7cf8db7a4e3..3ab915b4991 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/PostgreSQL.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/PostgreSQL.ts @@ -213,7 +213,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Redis.ts b/inlong-dashboard/src/plugins/sinks/defaults/Redis.ts index ad8d1fd365b..3fe3a74c77f 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/Redis.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/Redis.ts @@ -451,7 +451,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/SQLServer.ts b/inlong-dashboard/src/plugins/sinks/defaults/SQLServer.ts index 5f774fa9635..03440bef94b 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/SQLServer.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/SQLServer.ts @@ -252,7 +252,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/StarRocks.ts b/inlong-dashboard/src/plugins/sinks/defaults/StarRocks.ts index f86a24d15ae..bc3c7304123 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/StarRocks.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/StarRocks.ts @@ -160,7 +160,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sinks/defaults/TDSQLPostgreSQL.ts b/inlong-dashboard/src/plugins/sinks/defaults/TDSQLPostgreSQL.ts index 93c692422a6..5f98857bb15 100644 --- a/inlong-dashboard/src/plugins/sinks/defaults/TDSQLPostgreSQL.ts +++ b/inlong-dashboard/src/plugins/sinks/defaults/TDSQLPostgreSQL.ts @@ -208,7 +208,7 @@ const getFieldListColumns = sinkValues => { rules: [ { required: true }, { - pattern: /^[a-z][0-9a-z_]*$/, + pattern: /^[_a-zA-Z][0-9a-z_]*$/, message: i18n.t('meta.Sinks.SinkFieldNameRule'), }, ], diff --git a/inlong-dashboard/src/plugins/sources/defaults/File.ts b/inlong-dashboard/src/plugins/sources/defaults/File.ts index ca7ef844c8e..219c4948e7d 100644 --- a/inlong-dashboard/src/plugins/sources/defaults/File.ts +++ b/inlong-dashboard/src/plugins/sources/defaults/File.ts @@ -150,28 +150,6 @@ export default class PulsarSource @I18n('meta.Sources.File.MaxFileCount') maxFileCount: number; - @FieldDecorator({ - type: 'radio', - rules: [{ required: true }], - initialValue: 'default', - props: values => ({ - disabled: Boolean(values.id), - options: [ - { - label: 'Default', - value: 'default', - }, - { - label: 'Mix', - value: 'mix', - }, - ], - }), - }) - @IngestionField() - @I18n('meta.Sources.File.DataContentStyle') - dataContentStyle: string; - @FieldDecorator({ type: 'radio', props: values => ({ @@ -229,5 +207,5 @@ export default class PulsarSource }) @IngestionField() @I18n('meta.Sources.File.TimeZone') - timeZone: string; + agentTimeZone: string; } diff --git a/inlong-dashboard/src/ui/locales/cn.json b/inlong-dashboard/src/ui/locales/cn.json index c37d240a779..15dc20f3250 100644 --- a/inlong-dashboard/src/ui/locales/cn.json +++ b/inlong-dashboard/src/ui/locales/cn.json @@ -35,7 +35,6 @@ "meta.Sources.File.TimeOffsetHelp": "从文件的某个时间开始采集,'1m'表示1分钟之后,'-1m'表示1分钟之前,支持m(分钟),h(小时),d(天),空则从当前时间开始采集", "meta.Sources.File.TimeOffsetRules": "只能包含数字和字母 m、h、d", "meta.Sources.File.MaxFileCount": "最大文件数量", - "meta.Sources.File.DataContentStyle": "数据内容样式", "meta.Sources.File.Cycle": "周期", "meta.Sources.File.Cycle.Day": "天", "meta.Sources.File.Cycle.Hour": "小时", diff --git a/inlong-dashboard/src/ui/locales/en.json b/inlong-dashboard/src/ui/locales/en.json index a7140354447..94de245a1a3 100644 --- a/inlong-dashboard/src/ui/locales/en.json +++ b/inlong-dashboard/src/ui/locales/en.json @@ -35,7 +35,6 @@ "meta.Sources.File.TimeOffsetHelp": "The file will be collected from a certain time,' 1m' means 1 minute later,' -1m' means 1 minute before, and m(minute), h(hour), d(day) are supported. If it is empty, the file will be collected from the current time", "meta.Sources.File.TimeOffsetRules": "Can only contain numbers and letters m, h, d", "meta.Sources.File.MaxFileCount": "Max file count", - "meta.Sources.File.DataContentStyle": "Data content style", "meta.Sources.File.Cycle": "Cycle", "meta.Sources.File.Cycle.Day": "Day", "meta.Sources.File.Cycle.Hour": "Hour",