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 b4a20124af [INLONG-8881][Dashboard] Support management of Pulsar sink 
(#8907)
b4a20124af is described below

commit b4a20124afee3f9b72f4327af1d18e1fb3f520f3
Author: Lizhen <[email protected]>
AuthorDate: Wed Sep 13 14:27:01 2023 +0800

    [INLONG-8881][Dashboard] Support management of Pulsar sink (#8907)
---
 .../src/plugins/nodes/defaults/Pulsar.ts           |   4 +-
 .../src/plugins/sinks/defaults/Pulsar.ts           |  94 +++++++++++++++++++++
 .../src/plugins/sinks/defaults/index.ts            |   5 ++
 .../src/ui/components/CheckCard/logo/Pulsar.png    | Bin 0 -> 2722 bytes
 inlong-dashboard/src/ui/locales/cn.json            |   3 +
 inlong-dashboard/src/ui/locales/en.json            |   3 +
 6 files changed, 107 insertions(+), 2 deletions(-)

diff --git a/inlong-dashboard/src/plugins/nodes/defaults/Pulsar.ts 
b/inlong-dashboard/src/plugins/nodes/defaults/Pulsar.ts
index 435b4b717a..e1da61d7ad 100644
--- a/inlong-dashboard/src/plugins/nodes/defaults/Pulsar.ts
+++ b/inlong-dashboard/src/plugins/nodes/defaults/Pulsar.ts
@@ -43,12 +43,12 @@ export default class PulsarNode extends NodeInfo implements 
DataWithBackend, Ren
       placeholder: 'http://127.0.0.1:8080,127.0.1.2:8080',
     },
   })
-  @I18n('adminUrl')
+  @I18n('Admin URL')
   adminUrl: string;
 
   @FieldDecorator({
     type: 'password',
   })
-  @I18n('token')
+  @I18n('Token')
   token: string;
 }
diff --git a/inlong-dashboard/src/plugins/sinks/defaults/Pulsar.ts 
b/inlong-dashboard/src/plugins/sinks/defaults/Pulsar.ts
new file mode 100644
index 0000000000..c239887dac
--- /dev/null
+++ b/inlong-dashboard/src/plugins/sinks/defaults/Pulsar.ts
@@ -0,0 +1,94 @@
+/*
+ * 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 { SinkInfo } from '../common/SinkInfo';
+import NodeSelect from '@/ui/components/NodeSelect';
+
+const { I18n } = DataWithBackend;
+const { FieldDecorator, SyncField } = RenderRow;
+const { ColumnDecorator } = RenderList;
+
+export default class PulsarSink extends SinkInfo implements DataWithBackend, 
RenderRow, RenderList {
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+    }),
+  })
+  @ColumnDecorator()
+  @SyncField()
+  @I18n('meta.Sinks.Pulsar.Tenant')
+  pulsarTenant: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+    }),
+  })
+  @ColumnDecorator()
+  @SyncField()
+  @I18n('meta.Sinks.Pulsar.Namespace')
+  namespace: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+    }),
+  })
+  @ColumnDecorator()
+  @SyncField()
+  @I18n('Topic')
+  topic: string;
+
+  @FieldDecorator({
+    type: 'inputnumber',
+    initialValue: 1,
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+      min: 1,
+      max: 100,
+      precision: 0,
+    }),
+    rules: [{ required: true }],
+  })
+  @I18n('meta.Sinks.Pulsar.PartitionNum')
+  @ColumnDecorator()
+  partitionNum: number;
+
+  @FieldDecorator({
+    type: NodeSelect,
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+      nodeType: 'PULSAR',
+    }),
+  })
+  @I18n('meta.Sinks.DataNodeName')
+  @SyncField()
+  @ColumnDecorator()
+  dataNodeName: string;
+}
diff --git a/inlong-dashboard/src/plugins/sinks/defaults/index.ts 
b/inlong-dashboard/src/plugins/sinks/defaults/index.ts
index 46f8c362ee..d404bd2a0d 100644
--- a/inlong-dashboard/src/plugins/sinks/defaults/index.ts
+++ b/inlong-dashboard/src/plugins/sinks/defaults/index.ts
@@ -86,6 +86,11 @@ export const allDefaultSinks: 
MetaExportWithBackendList<SinkMetaType> = [
     value: 'POSTGRESQL',
     LoadEntity: () => import('./PostgreSQL'),
   },
+  {
+    label: 'Pulsar',
+    value: 'PULSAR',
+    LoadEntity: () => import('./Pulsar'),
+  },
   {
     label: 'SQLServer',
     value: 'SQLSERVER',
diff --git a/inlong-dashboard/src/ui/components/CheckCard/logo/Pulsar.png 
b/inlong-dashboard/src/ui/components/CheckCard/logo/Pulsar.png
new file mode 100644
index 0000000000..d71b379aab
Binary files /dev/null and 
b/inlong-dashboard/src/ui/components/CheckCard/logo/Pulsar.png differ
diff --git a/inlong-dashboard/src/ui/locales/cn.json 
b/inlong-dashboard/src/ui/locales/cn.json
index 538f74748b..77fc672f18 100644
--- a/inlong-dashboard/src/ui/locales/cn.json
+++ b/inlong-dashboard/src/ui/locales/cn.json
@@ -366,6 +366,9 @@
   "meta.Sinks.Kudu.PartitionStrategy": "分区策略",
   "meta.Sinks.Kudu.FieldDescription": "描述",
   "meta.Sinks.Kudu.buckets": "Buckets",
+  "meta.Sinks.Pulsar.Tenant": "Pulsar 租户",
+  "meta.Sinks.Pulsar.Namespace": "命名空间",
+  "meta.Sinks.Pulsar.PartitionNum": "分区数",
   "meta.Group.InlongGroupId": "数据流组 ID",
   "meta.Group.InlongGroupIdRules": "只能包含英文字母、数字、点号(.)、中划线(-)、下划线(_)",
   "meta.Group.InlongGroupName": "数据流组名称",
diff --git a/inlong-dashboard/src/ui/locales/en.json 
b/inlong-dashboard/src/ui/locales/en.json
index 57ec0b8530..ff6e0c3299 100644
--- a/inlong-dashboard/src/ui/locales/en.json
+++ b/inlong-dashboard/src/ui/locales/en.json
@@ -366,6 +366,9 @@
   "meta.Sinks.Kudu.PartitionStrategy": "PartitionStrategy",
   "meta.Sinks.Kudu.FieldDescription": "FieldDescription",
   "meta.Sinks.Kudu.buckets": "Buckets",
+  "meta.Sinks.Pulsar.Tenant": "Pulsar Tenant",
+  "meta.Sinks.Pulsar.Namespace": "Namespace",
+  "meta.Sinks.Pulsar.PartitionNum": "Partition Number",
   "meta.Group.InlongGroupId": "Inlong Group ID",
   "meta.Group.InlongGroupIdRules": "Only English letters, numbers, dots(.), 
minus(-), and underscores(_)",
   "meta.Group.InlongGroupName": "Inlong Group Name",

Reply via email to