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 5a57be380 [INLONG-6761][Dashboard] Support Iceberg node management 
(#6767)
5a57be380 is described below

commit 5a57be380fc65d50799275c37ea61bed8529f464
Author: Lizhen <[email protected]>
AuthorDate: Wed Dec 7 09:51:20 2022 +0800

    [INLONG-6761][Dashboard] Support Iceberg node management (#6767)
---
 inlong-dashboard/src/locales/cn.json               |  7 +-
 inlong-dashboard/src/locales/en.json               |  7 +-
 .../src/metas/nodes/defaults/Iceberg.ts            | 87 ++++++++++++++++++++++
 inlong-dashboard/src/metas/nodes/defaults/index.ts |  5 ++
 .../src/metas/sinks/defaults/Iceberg.ts            | 40 +++++-----
 5 files changed, 127 insertions(+), 19 deletions(-)

diff --git a/inlong-dashboard/src/locales/cn.json 
b/inlong-dashboard/src/locales/cn.json
index 628b8f203..4f2699f4f 100644
--- a/inlong-dashboard/src/locales/cn.json
+++ b/inlong-dashboard/src/locales/cn.json
@@ -167,7 +167,6 @@
   "meta.Sinks.Kafka.AutoOffsetReset": "自动偏移量重置",
   "meta.Sinks.Iceberg.DbName": "DB名称",
   "meta.Sinks.Iceberg.TableName": "表名称",
-  "meta.Sinks.Iceberg.Warehouse": "仓库路径",
   "meta.Sinks.Iceberg.FileFormat": "⽂件格式",
   "meta.Sinks.Iceberg.Description": "表描述",
   "meta.Sinks.Iceberg.ExtList": "属性",
@@ -177,6 +176,7 @@
   "meta.Sinks.Iceberg.FieldType": "字段类型",
   "meta.Sinks.Iceberg.FieldDescription": "字段描述",
   "meta.Sinks.Iceberg.PartitionStrategy": "分区策略",
+  "meta.Sinks.Iceberg.DataNodeName": "数据节点",
   "meta.Sinks.Greenplum.TableName": "表名称",
   "meta.Sinks.Greenplum.PrimaryKey": "主键",
   "meta.Sinks.Greenplum.FieldName": "字段名",
@@ -360,6 +360,11 @@
   "meta.Nodes.ES.KeywordMaxLength": "keyword类型的最大长度",
   "meta.Nodes.ES.IsUseIndexId": "是否创建index id",
   "meta.Nodes.ES.MaxThreads": "最大线程数",
+  "meta.Nodes.Iceberg.Username": "用户名",
+  "meta.Nodes.Iceberg.Password": "密码",
+  "meta.Nodes.Iceberg.Url": "地址",
+  "meta.Nodes.Iceberg.Warehouse": "仓库路径",
+  "meta.Nodes.Iceberg.CatalogType": "目录类型",
   "components.EditableTable.NewLine": "新增一行",
   "components.FormGenerator.plugins.PleaseChoose": "请选择",
   "components.FormGenerator.plugins.PleaseInput": "请输入",
diff --git a/inlong-dashboard/src/locales/en.json 
b/inlong-dashboard/src/locales/en.json
index af7edc492..5caf66b43 100644
--- a/inlong-dashboard/src/locales/en.json
+++ b/inlong-dashboard/src/locales/en.json
@@ -167,7 +167,6 @@
   "meta.Sinks.Kafka.AutoOffsetReset": "AutoOffsetReset",
   "meta.Sinks.Iceberg.DbName": "DbName",
   "meta.Sinks.Iceberg.TableName": "TableName",
-  "meta.Sinks.Iceberg.Warehouse": "Warehouse",
   "meta.Sinks.Iceberg.FileFormat": "FileFormat",
   "meta.Sinks.Iceberg.Description": "Description",
   "meta.Sinks.Iceberg.ExtList": "ExtList",
@@ -177,6 +176,7 @@
   "meta.Sinks.Iceberg.FieldType": "FieldType",
   "meta.Sinks.Iceberg.FieldDescription": "FieldDescription",
   "meta.Sinks.Iceberg.PartitionStrategy": "PartitionStrategy",
+  "meta.Sinks.Iceberg.DataNodeName": "DataNode",
   "meta.Sinks.Greenplum.TableName": "TableName",
   "meta.Sinks.Greenplum.PrimaryKey": "PrimaryKey",
   "meta.Sinks.Greenplum.FieldName": "FieldName",
@@ -360,6 +360,11 @@
   "meta.Nodes.ES.KeywordMaxLength": "Max keyword length",
   "meta.Nodes.ES.IsUseIndexId": "Create index id or not",
   "meta.Nodes.ES.MaxThreads": "MaxThreads",
+  "meta.Nodes.Iceberg.Username": "Username",
+  "meta.Nodes.Iceberg.Password": "Password",
+  "meta.Nodes.Iceberg.Url": "URL",
+  "meta.Nodes.Iceberg.Warehouse": "Warehouse",
+  "meta.Nodes.Iceberg.CatalogType": "Catalog Type",
   "components.EditableTable.NewLine": "New line",
   "components.FormGenerator.plugins.PleaseChoose": "Please select",
   "components.FormGenerator.plugins.PleaseInput": "Please input",
diff --git a/inlong-dashboard/src/metas/nodes/defaults/Iceberg.ts 
b/inlong-dashboard/src/metas/nodes/defaults/Iceberg.ts
new file mode 100644
index 000000000..ebb5483fa
--- /dev/null
+++ b/inlong-dashboard/src/metas/nodes/defaults/Iceberg.ts
@@ -0,0 +1,87 @@
+/*
+ * 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 '@/metas/DataWithBackend';
+import { RenderRow } from '@/metas/RenderRow';
+import { RenderList } from '@/metas/RenderList';
+import { NodeInfo } from '../common/NodeInfo';
+
+const { I18n } = DataWithBackend;
+const { FieldDecorator } = RenderRow;
+
+export default class IcebergNode
+  extends NodeInfo
+  implements DataWithBackend, RenderRow, RenderList
+{
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+  })
+  @I18n('meta.Nodes.Iceberg.Username')
+  username: string;
+
+  @FieldDecorator({
+    type: 'password',
+    rules: [{ required: true }],
+  })
+  @I18n('meta.Nodes.Iceberg.Password')
+  token: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+      placeholder: 'thrift://127.0.0.1:9083',
+    }),
+  })
+  @I18n('meta.Nodes.Iceberg.Url')
+  url: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+      placeholder: 'hdfs://127.0.0.1:9000/user/iceberg/warehouse',
+    }),
+  })
+  @I18n('meta.Nodes.Iceberg.Warehouse')
+  warehouse: string;
+
+  @FieldDecorator({
+    type: 'select',
+    initialValue: 'HIVE',
+    props: values => ({
+      disabled: [110, 130].includes(values?.status),
+      options: [
+        {
+          label: 'HIVE',
+          value: 'HIVE',
+        },
+        {
+          label: 'HADOOP',
+          value: 'HADOOP',
+        },
+      ],
+    }),
+  })
+  @I18n('meta.Nodes.Iceberg.CatalogType')
+  catalogType: string;
+}
diff --git a/inlong-dashboard/src/metas/nodes/defaults/index.ts 
b/inlong-dashboard/src/metas/nodes/defaults/index.ts
index ef5c438cf..b6bc43696 100644
--- a/inlong-dashboard/src/metas/nodes/defaults/index.ts
+++ b/inlong-dashboard/src/metas/nodes/defaults/index.ts
@@ -36,6 +36,11 @@ export const allDefaultNodes: 
MetaExportWithBackendList<NodeMetaType> = [
     value: 'HIVE',
     LoadEntity: () => import('./Hive'),
   },
+  {
+    label: 'Iceberg',
+    value: 'ICEBERG',
+    LoadEntity: () => import('./Iceberg'),
+  },
   {
     label: 'MySQL',
     value: 'MYSQL',
diff --git a/inlong-dashboard/src/metas/sinks/defaults/Iceberg.ts 
b/inlong-dashboard/src/metas/sinks/defaults/Iceberg.ts
index 7d7b0eda0..2f6f07fd8 100644
--- a/inlong-dashboard/src/metas/sinks/defaults/Iceberg.ts
+++ b/inlong-dashboard/src/metas/sinks/defaults/Iceberg.ts
@@ -154,28 +154,34 @@ export default class IcebergSink
   enableCreateResource: number;
 
   @FieldDecorator({
-    type: 'input',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: [110, 130].includes(values?.status),
-      placeholder: 'thrift://127.0.0.1:9083',
-    }),
-  })
-  @ColumnDecorator()
-  @I18n('Catalog URI')
-  catalogUri: string;
-
-  @FieldDecorator({
-    type: 'input',
+    type: 'select',
     rules: [{ required: true }],
     props: values => ({
+      showSearch: true,
       disabled: [110, 130].includes(values?.status),
-      placeholder: 'hdfs://127.0.0.1:9000/user/iceberg/warehouse',
+      options: {
+        requestService: keyword => ({
+          url: '/node/list',
+          method: 'POST',
+          data: {
+            keyword,
+            type: 'ICEBERG',
+            pageNum: 1,
+            pageSize: 20,
+          },
+        }),
+        requestParams: {
+          formatResult: result =>
+            result?.list?.map(item => ({
+              label: item.name,
+              value: item.name,
+            })),
+        },
+      },
     }),
   })
-  @ColumnDecorator()
-  @I18n('meta.Sinks.Iceberg.Warehouse')
-  warehouse: string;
+  @I18n('meta.Sinks.Iceberg.DataNodeName')
+  dataNodeName: string;
 
   @FieldDecorator({
     type: 'select',

Reply via email to