This is an automated email from the ASF dual-hosted git repository.
dockerzhang 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 3d7086fce5 [INLONG-9497][Dashboard] Support Pulsar source management
(#9498)
3d7086fce5 is described below
commit 3d7086fce584ac445fc9e359552c59fca951eac0
Author: Lizhen <[email protected]>
AuthorDate: Wed Dec 20 12:39:03 2023 +0800
[INLONG-9497][Dashboard] Support Pulsar source management (#9498)
---
.../src/plugins/sources/defaults/Pulsar.ts | 172 +++++++++++++++++++++
.../src/plugins/sources/defaults/index.ts | 5 +
inlong-dashboard/src/ui/locales/cn.json | 7 +
inlong-dashboard/src/ui/locales/en.json | 7 +
4 files changed, 191 insertions(+)
diff --git a/inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts
b/inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts
new file mode 100644
index 0000000000..039fc6044c
--- /dev/null
+++ b/inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { DataWithBackend } from '@/plugins/DataWithBackend';
+import { RenderRow } from '@/plugins/RenderRow';
+import { RenderList } from '@/plugins/RenderList';
+import { SourceInfo } from '../common/SourceInfo';
+
+const { I18n } = DataWithBackend;
+const { FieldDecorator, SyncField } = RenderRow;
+const { ColumnDecorator } = RenderList;
+
+export default class PulsarSource
+ extends SourceInfo
+ implements DataWithBackend, RenderRow, RenderList
+{
+ @FieldDecorator({
+ type: 'input',
+ rules: [{ required: true }],
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @ColumnDecorator()
+ @SyncField()
+ @I18n('meta.Sources.Pulsar.PulsarTenant')
+ pulsarTenant: string;
+
+ @FieldDecorator({
+ type: 'input',
+ rules: [{ required: true }],
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @SyncField()
+ @I18n('meta.Sources.Pulsar.Namespace')
+ namespace: string;
+
+ @FieldDecorator({
+ type: 'input',
+ rules: [{ required: true }],
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @SyncField()
+ @I18n('Admin url')
+ adminUrl: string;
+
+ @FieldDecorator({
+ type: 'input',
+ rules: [{ required: true }],
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @SyncField()
+ @I18n('Service url')
+ serviceUrl: string;
+
+ @FieldDecorator({
+ type: 'input',
+ rules: [{ required: true }],
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @SyncField()
+ @I18n('Pulsar topic')
+ topic: string;
+
+ @FieldDecorator({
+ type: 'input',
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @ColumnDecorator()
+ @SyncField()
+ @I18n('meta.Sources.Pulsar.PrimaryKey')
+ primaryKey: string;
+
+ @FieldDecorator({
+ type: 'radio',
+ initialValue: 'UTF-8',
+ props: values => ({
+ disabled: values?.status === 101,
+ options: [
+ {
+ label: 'UTF-8',
+ value: 'UTF-8',
+ },
+ {
+ label: 'GBK',
+ value: 'GBK',
+ },
+ ],
+ }),
+ })
+ @ColumnDecorator()
+ @SyncField()
+ @I18n('meta.Sources.Pulsar.DataEncoding')
+ dataEncoding: string;
+
+ @FieldDecorator({
+ type: 'input',
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @ColumnDecorator()
+ @SyncField()
+ @I18n('meta.Sources.Pulsar.DataSeparator')
+ dataSeparator: string;
+
+ @FieldDecorator({
+ type: 'input',
+ props: values => ({
+ disabled: values?.status === 101,
+ }),
+ })
+ @ColumnDecorator()
+ @SyncField()
+ @I18n('meta.Sources.Pulsar.DataEscapeChar')
+ dataEscapeChar: string;
+
+ @FieldDecorator({
+ type: 'radio',
+ initialValue: 'INLONG_MSG_V0',
+ props: values => ({
+ disabled: values?.status === 101,
+ options: [
+ {
+ label: 'InLongMsg V0',
+ value: 'INLONG_MSG_V0',
+ },
+ {
+ label: 'InLongMsg V1',
+ value: 'INLONG_MSG_V1',
+ },
+ {
+ label: 'Raw',
+ value: 'RAW',
+ },
+ {
+ label: 'Etc',
+ value: 'etc',
+ },
+ ],
+ }),
+ })
+ @SyncField()
+ @I18n('meta.Sources.Pulsar.WrapType')
+ wrapType: string;
+}
diff --git a/inlong-dashboard/src/plugins/sources/defaults/index.ts
b/inlong-dashboard/src/plugins/sources/defaults/index.ts
index c9bbf3174e..aea16927cb 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/index.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/index.ts
@@ -64,6 +64,11 @@ export const allDefaultSources:
MetaExportWithBackendList<SourceMetaType> = [
value: 'POSTGRESQL',
LoadEntity: () => import('./PostgreSQL'),
},
+ {
+ label: 'Pulsar',
+ value: 'PULSAR',
+ LoadEntity: () => import('./Pulsar'),
+ },
{
label: 'Redis',
value: 'REDIS',
diff --git a/inlong-dashboard/src/ui/locales/cn.json
b/inlong-dashboard/src/ui/locales/cn.json
index b08d29c217..5621a89c13 100644
--- a/inlong-dashboard/src/ui/locales/cn.json
+++ b/inlong-dashboard/src/ui/locales/cn.json
@@ -130,6 +130,13 @@
"meta.Sources.Iceberg.TableName": "表格名称",
"meta.Sources.Iceberg.PrimaryKey": "主键",
"meta.Sources.Iceberg.Warehouse": "仓库路径",
+ "meta.Sources.Pulsar.PulsarTenant": "Pulsar 租户",
+ "meta.Sources.Pulsar.Namespace": "命名空间",
+ "meta.Sources.Pulsar.PrimaryKey": "主键",
+ "meta.Sources.Pulsar.DataEncoding": "数据编码",
+ "meta.Sources.Pulsar.DataSeparator": "数据分隔符",
+ "meta.Sources.Pulsar.DataEscapeChar": "数据转义符",
+ "meta.Sources.Pulsar.WrapType": "消息打包格式",
"meta.Sinks.SinkName": "名称",
"meta.Sinks.SinkNameRule": "只能包含英文字母、数字、点号(.)、中划线(-)、下划线(_)",
"meta.Sinks.SinkType": "类型",
diff --git a/inlong-dashboard/src/ui/locales/en.json
b/inlong-dashboard/src/ui/locales/en.json
index 94fd002ff9..e75c8fe4ab 100644
--- a/inlong-dashboard/src/ui/locales/en.json
+++ b/inlong-dashboard/src/ui/locales/en.json
@@ -130,6 +130,13 @@
"meta.Sources.Iceberg.TableName": "TableName",
"meta.Sources.Iceberg.PrimaryKey": "Primary key",
"meta.Sources.Iceberg.Warehouse": "Warehouse",
+ "meta.Sources.Pulsar.PulsarTenant": "Pulsar tenant",
+ "meta.Sources.Pulsar.Namespace": "Namespace",
+ "meta.Sources.Pulsar.PrimaryKey": "Primary key",
+ "meta.Sources.Pulsar.DataEncoding": "Data encoding",
+ "meta.Sources.Pulsar.DataSeparator": "Data separator",
+ "meta.Sources.Pulsar.DataEscapeChar": "Data escape char",
+ "meta.Sources.Pulsar.WrapType": "Wrap type",
"meta.Sinks.SinkName": "Name",
"meta.Sinks.SinkNameRule": "Only English letters, numbers, dots(.),
minus(-), and underscores(_)",
"meta.Sinks.SinkType": "Type",