You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by le...@apache.org on 2022/11/08 10:23:07 UTC

[inlong] branch master updated: [INLONG-6456][Dashboard] Supports management of Oracle sources (#6469)

This is an automated email from the ASF dual-hosted git repository.

leezng 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 f0aec5b7a [INLONG-6456][Dashboard] Supports management of Oracle sources (#6469)
f0aec5b7a is described below

commit f0aec5b7af7f483edcd4c2526e0e37e93ef57460
Author: Lizhen <88...@users.noreply.github.com>
AuthorDate: Tue Nov 8 18:23:00 2022 +0800

    [INLONG-6456][Dashboard] Supports management of Oracle sources (#6469)
---
 inlong-dashboard/src/locales/cn.json               |  10 ++
 inlong-dashboard/src/locales/en.json               |  10 ++
 .../src/metas/sources/defaults/Oracle.ts           | 161 +++++++++++++++++++++
 .../src/metas/sources/defaults/index.ts            |   5 +
 4 files changed, 186 insertions(+)

diff --git a/inlong-dashboard/src/locales/cn.json b/inlong-dashboard/src/locales/cn.json
index 3d74445f9..c5ad9c67a 100644
--- a/inlong-dashboard/src/locales/cn.json
+++ b/inlong-dashboard/src/locales/cn.json
@@ -39,6 +39,16 @@
   "meta.Sources.Mongodb.Database": "数据库名",
   "meta.Sources.Mongodb.Collection": "集合名称",
   "meta.Sources.Mongodb.PrimaryKey": "主键",
+  "meta.Sources.Oracle.Hostname": "服务器主机",
+  "meta.Sources.Oracle.Port": "端口",
+  "meta.Sources.Oracle.Username": "用户",
+  "meta.Sources.Oracle.Password": "密码",
+  "meta.Sources.Oracle.Database": "数据库名",
+  "meta.Sources.Oracle.SchemaName": "集合名称",
+  "meta.Sources.Oracle.TableName": "表格名称",
+  "meta.Sources.Oracle.AllMigration": "是否整库迁移",
+  "meta.Sources.Oracle.ScanStartupMode": "扫描启动模式",
+  "meta.Sources.Oracle.PrimaryKey": "主键",
   "meta.Sinks.SinkName": "名称",
   "meta.Sinks.SinkNameRule": "以英文字母开头,只能包含英文字母、数字、中划线、下划线",
   "meta.Sinks.SinkType": "类型",
diff --git a/inlong-dashboard/src/locales/en.json b/inlong-dashboard/src/locales/en.json
index 5c7ba9880..dc7f103a1 100644
--- a/inlong-dashboard/src/locales/en.json
+++ b/inlong-dashboard/src/locales/en.json
@@ -39,6 +39,16 @@
   "meta.Sources.Mongodb.Database": "Database",
   "meta.Sources.Mongodb.Collection": "Collection",
   "meta.Sources.Mongodb.PrimaryKey": "PrimaryKey",
+  "meta.Sources.Oracle.Hostname": "Hostname",
+  "meta.Sources.Oracle.Port": "Port",
+  "meta.Sources.Oracle.Username": "Username",
+  "meta.Sources.Oracle.Password": "Password",
+  "meta.Sources.Oracle.Database": "Database",
+  "meta.Sources.Oracle.SchemaName": "SchemaName",
+  "meta.Sources.Oracle.TableName": "TableName",
+  "meta.Sources.Oracle.AllMigration": "AllMigration",
+  "meta.Sources.Oracle.ScanStartupMode": "Scan startup mode",
+  "meta.Sources.Oracle.PrimaryKey": "PrimaryKey",
   "meta.Sinks.SinkName": "Name",
   "meta.Sinks.SinkNameRule": "At the beginning of English letters, only English letters, numbers, minus, and underscores",
   "meta.Sinks.SinkType": "Type",
diff --git a/inlong-dashboard/src/metas/sources/defaults/Oracle.ts b/inlong-dashboard/src/metas/sources/defaults/Oracle.ts
new file mode 100644
index 000000000..2cc458e90
--- /dev/null
+++ b/inlong-dashboard/src/metas/sources/defaults/Oracle.ts
@@ -0,0 +1,161 @@
+/*
+ * 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 { SourceInfo } from '../common/SourceInfo';
+import i18n from '@/i18n';
+
+const { I18n } = DataWithBackend;
+const { FieldDecorator } = RenderRow;
+const { ColumnDecorator } = RenderList;
+
+export default class OracleSource
+  extends SourceInfo
+  implements DataWithBackend, RenderRow, RenderList
+{
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+    }),
+  })
+  @ColumnDecorator()
+  @I18n('meta.Sources.Oracle.Hostname')
+  hostname: string;
+
+  @FieldDecorator({
+    type: 'inputnumber',
+    rules: [{ required: true }],
+    initialValue: 1521,
+    props: values => ({
+      min: 1,
+      max: 65535,
+      disabled: values?.status === 101,
+    }),
+  })
+  @ColumnDecorator()
+  @I18n('meta.Sources.Oracle.Port')
+  port: number;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+    }),
+  })
+  @ColumnDecorator()
+  @I18n('meta.Sources.Oracle.Username')
+  username: string;
+
+  @FieldDecorator({
+    type: 'password',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+    }),
+  })
+  @I18n('meta.Sources.Oracle.Password')
+  password: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+    }),
+  })
+  @I18n('meta.Sources.Oracle.Database')
+  database: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+    }),
+  })
+  @I18n('meta.Sources.Oracle.SchemaName')
+  schemaName: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+    }),
+  })
+  @I18n('meta.Sources.Oracle.TableName')
+  tableName: string;
+
+  @FieldDecorator({
+    type: 'radio',
+    rules: [{ required: true }],
+    initialValue: false,
+    props: values => ({
+      disabled: values?.status === 101,
+      options: [
+        {
+          label: i18n.t('basic.Yes'),
+          value: true,
+        },
+        {
+          label: i18n.t('basic.No'),
+          value: false,
+        },
+      ],
+    }),
+  })
+  @I18n('meta.Sources.Oracle.AllMigration')
+  allMigration: boolean;
+
+  @FieldDecorator({
+    type: 'radio',
+    initialValue: 'initial',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+      options: [
+        {
+          label: 'initial',
+          value: 'initial',
+        },
+        {
+          label: 'latest-offset',
+          value: 'latest-offset',
+        },
+      ],
+    }),
+  })
+  @I18n('meta.Sources.Oracle.ScanStartupMode')
+  scanStartupMode: string;
+
+  @FieldDecorator({
+    type: 'input',
+    rules: [{ required: true }],
+    props: values => ({
+      disabled: values?.status === 101,
+    }),
+  })
+  @I18n('meta.Sources.Oracle.PrimaryKey')
+  primaryKey: string;
+}
diff --git a/inlong-dashboard/src/metas/sources/defaults/index.ts b/inlong-dashboard/src/metas/sources/defaults/index.ts
index 8f2843153..881a7ff9a 100644
--- a/inlong-dashboard/src/metas/sources/defaults/index.ts
+++ b/inlong-dashboard/src/metas/sources/defaults/index.ts
@@ -46,4 +46,9 @@ export const allDefaultSources: MetaExportWithBackendList<SourceMetaType> = [
     value: 'MONGODB',
     LoadEntity: () => import('./Mongodb'),
   },
+  {
+    label: 'Oracle',
+    value: 'ORACLE',
+    LoadEntity: () => import('./Oracle'),
+  },
 ];