This is an automated email from the ASF dual-hosted git repository.
zirui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new f2b574f457 [INLONG-9505][Dashboard] Pulsar source parameter
optimization (#9506)
f2b574f457 is described below
commit f2b574f45749a0c1ad690ce7de9a120c53bff53f
Author: Lizhen <88174078+bluew...@users.noreply.github.com>
AuthorDate: Wed Dec 27 15:57:55 2023 +0800
[INLONG-9505][Dashboard] Pulsar source parameter optimization (#9506)
---
.../plugins/sources/common/SourceDefaultInfo.ts| 26 ++--
.../src/plugins/sources/defaults/File.ts | 11 +++-
.../src/plugins/sources/defaults/Hudi.ts | 9 ++-
.../src/plugins/sources/defaults/Iceberg.ts| 7 ++-
.../src/plugins/sources/defaults/MQTT.ts | 9 ++-
.../src/plugins/sources/defaults/Mongodb.ts| 8 ++-
.../src/plugins/sources/defaults/MySQLBinlog.ts| 13 +++-
.../src/plugins/sources/defaults/Oracle.ts | 12 +++-
.../src/plugins/sources/defaults/PostgreSQL.ts | 11 +++-
.../src/plugins/sources/defaults/Pulsar.ts | 70 --
.../src/plugins/sources/defaults/Redis.ts | 13 +++-
.../src/plugins/sources/defaults/SQLServer.ts | 12 +++-
inlong-dashboard/src/ui/locales/cn.json| 1 +
inlong-dashboard/src/ui/locales/en.json| 1 +
.../ui/pages/SynchronizeDetail/SyncAudit/index.tsx | 2 +-
.../SynchronizeDetail/SyncSources/DetailModal.tsx | 3 +
16 files changed, 163 insertions(+), 45 deletions(-)
diff --git a/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts
b/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts
index b06f4795ec..c9948c39fa 100644
--- a/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts
+++ b/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts
@@ -27,8 +27,16 @@ import { sources, defaultValue } from '..';
import i18n from '@/i18n';
const { I18nMap, I18n } = DataWithBackend;
-const { FieldList, FieldDecorator, SyncField, SyncFieldSet, SyncMoveDbField,
SyncMoveDbFieldSet } =
- RenderRow;
+const {
+ FieldList,
+ FieldDecorator,
+ SyncField,
+ SyncFieldSet,
+ SyncMoveDbField,
+ SyncMoveDbFieldSet,
+ IngestionField,
+ IngestionFieldSet,
+} = RenderRow;
const { ColumnList, ColumnDecorator } = RenderList;
export class SourceDefaultInfo implements DataWithBackend, RenderRow,
RenderList {
@@ -37,6 +45,7 @@ export class SourceDefaultInfo implements DataWithBackend,
RenderRow, RenderList
static ColumnList = ColumnList;
static SyncFieldSet = SyncFieldSet;
static SyncMoveDbFieldSet = SyncMoveDbFieldSet;
+ static IngestionFieldSet = IngestionFieldSet;
readonly id: number;
@@ -46,6 +55,7 @@ export class SourceDefaultInfo implements DataWithBackend,
RenderRow, RenderList
hidden: true,
})
@SyncField()
+ @IngestionField()
@SyncMoveDbField()
@I18n('inlongGroupId')
readonly inlongGroupId: string;
@@ -55,6 +65,7 @@ export class SourceDefaultInfo implements DataWithBackend,
RenderRow, RenderList
hidden: true,
})
@SyncField()
+ @IngestionField()
@SyncMoveDbField()
@I18n('inlongStreamId')
readonly inlongStreamId: string;
@@ -79,6 +90,7 @@ export class SourceDefaultInfo implements DataWithBackend,
RenderRow, RenderList
render: type => sources.find(c => c.value === type)?.label || type,
})
@SyncField()
+ @IngestionField()
@SyncMoveDbField()
@I18n('meta.Sources.Type')
sourceType: string;
@@ -100,6 +112,7 @@ export class SourceDefaultInfo implements DataWithBackend,
RenderRow, RenderList
})
@ColumnDecorator()
@SyncField()
+ @IngestionField()
@SyncMoveDbField()
@I18n('meta.Sources.Name')
sourceName: string;
@@ -117,15 +130,18 @@ export class SourceDefaultInfo implements
DataWithBackend, RenderRow, RenderList
render: text => genStatusTag(text),
})
@SyncField()
+ @IngestionField()
@SyncMoveDbField()
@I18n('basic.Status')
readonly status: string;
@ColumnDecorator()
+ @IngestionField()
@I18n('basic.Creator')
readonly creator: string;
@ColumnDecorator()
+ @IngestionField()
@I18n('basic.Modifier')
readonly modifier: string;
@@ -181,7 +197,8 @@ export class SourceDefaultInfo implements DataWithBackend,
RenderRow, RenderList
renderRow() {
const constructor = this.constructor as typeof SourceDefaultInfo;
-constructor.FieldList.map(item => {
+const { FieldList, IngestionFieldSet } = constructor;
+return FieldList.filter(item => {
if (item.name === 'sourceType') {
item.props = values => ({
disabled: Boolean(values.id),
@@ -195,8 +212,9 @@ export class SourceDefaultInfo implements DataWithBackend,
RenderRow, RenderList
})),
});
}
+ return IngestionFieldSet.has(item.name as string);
});
-return