You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2023/04/10 02:00:02 UTC

[inlong] branch master updated: [INLONG-7802][Dashboard] Requirements for optimizing data sources (#7806)

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 12c28381a [INLONG-7802][Dashboard] Requirements for optimizing data sources (#7806)
12c28381a is described below

commit 12c28381a79db352abdd2ad676f7c266e22fe947
Author: Lizhen <88...@users.noreply.github.com>
AuthorDate: Mon Apr 10 09:59:56 2023 +0800

    [INLONG-7802][Dashboard] Requirements for optimizing data sources (#7806)
---
 .../src/plugins/sources/defaults/MQTT.ts           |  20 ++-
 .../src/plugins/sources/defaults/Mongodb.ts        |   1 -
 .../src/plugins/sources/defaults/Oracle.ts         |   1 -
 .../src/plugins/sources/defaults/PostgreSQL.ts     |   1 -
 .../src/plugins/sources/defaults/Redis.ts          | 154 +++------------------
 .../src/plugins/sources/defaults/SQLServer.ts      |   1 -
 6 files changed, 30 insertions(+), 148 deletions(-)

diff --git a/inlong-dashboard/src/plugins/sources/defaults/MQTT.ts b/inlong-dashboard/src/plugins/sources/defaults/MQTT.ts
index 26bf1bacf..970b73d07 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/MQTT.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/MQTT.ts
@@ -71,31 +71,29 @@ export default class MQTTSource
   topic: string;
 
   @FieldDecorator({
-    type: 'inputnumber',
+    type: 'input',
     rules: [{ required: true }],
-    initialValue: 1,
     props: values => ({
       disabled: values?.status === 101,
-      min: 0,
-      max: 2,
     }),
   })
-  @I18n('QoS')
-  qos: number;
+  @I18n('Client ID')
+  clientId: string;
 
   @FieldDecorator({
-    type: 'input',
-    rules: [{ required: true }],
+    type: 'inputnumber',
+    initialValue: 1,
     props: values => ({
       disabled: values?.status === 101,
+      min: 0,
+      max: 2,
     }),
   })
-  @I18n('Client ID')
-  clientId: string;
+  @I18n('QoS')
+  qos: number;
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
     props: values => ({
       disabled: values?.status === 101,
     }),
diff --git a/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts b/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts
index 9e756d6bf..34f4bb0f7 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts
@@ -85,7 +85,6 @@ export default class MongodbSource
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
     props: values => ({
       disabled: values?.status === 101,
     }),
diff --git a/inlong-dashboard/src/plugins/sources/defaults/Oracle.ts b/inlong-dashboard/src/plugins/sources/defaults/Oracle.ts
index 504884784..0e87bd925 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/Oracle.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/Oracle.ts
@@ -151,7 +151,6 @@ export default class OracleSource
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
     props: values => ({
       disabled: values?.status === 101,
     }),
diff --git a/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts b/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts
index a4fc4a95b..a2b8ac099 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts
@@ -110,7 +110,6 @@ export default class PostgreSQLSource
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
     props: values => ({
       disabled: values?.status === 101,
     }),
diff --git a/inlong-dashboard/src/plugins/sources/defaults/Redis.ts b/inlong-dashboard/src/plugins/sources/defaults/Redis.ts
index 05cf370ee..1798dd310 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/Redis.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/Redis.ts
@@ -21,7 +21,6 @@ import { DataWithBackend } from '@/plugins/DataWithBackend';
 import { RenderRow } from '@/plugins/RenderRow';
 import { RenderList } from '@/plugins/RenderList';
 import { SourceInfo } from '../common/SourceInfo';
-import i18n from '@/i18n';
 
 const { I18n } = DataWithBackend;
 const { FieldDecorator } = RenderRow;
@@ -31,17 +30,6 @@ export default class RedisSource
   extends SourceInfo
   implements DataWithBackend, RenderRow, RenderList
 {
-  @FieldDecorator({
-    type: 'input',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @ColumnDecorator()
-  @I18n('meta.Sources.Redis.Hostname')
-  hostname: string;
-
   @FieldDecorator({
     type: 'inputnumber',
     rules: [{ required: true }],
@@ -53,20 +41,6 @@ export default class RedisSource
   @I18n('meta.Sources.Redis.Database')
   database: number;
 
-  @FieldDecorator({
-    type: 'inputnumber',
-    rules: [{ required: true }],
-    initialValue: 6379,
-    props: values => ({
-      min: 1,
-      max: 65535,
-      disabled: values?.status === 101,
-    }),
-  })
-  @ColumnDecorator()
-  @I18n('meta.Sources.Redis.Port')
-  port: number;
-
   @FieldDecorator({
     type: 'input',
     rules: [{ required: true }],
@@ -88,16 +62,6 @@ export default class RedisSource
   @I18n('meta.Sources.Redis.Password')
   password: string;
 
-  @FieldDecorator({
-    type: 'input',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @I18n('meta.Sources.Redis.PrimaryKey')
-  primaryKey: string;
-
   @FieldDecorator({
     type: 'select',
     rules: [{ required: true }],
@@ -130,7 +94,6 @@ export default class RedisSource
   @FieldDecorator({
     type: 'select',
     rules: [{ required: true }],
-    initialValue: 'cluster',
     props: values => ({
       disabled: values?.status === 101,
       options: [
@@ -154,9 +117,10 @@ export default class RedisSource
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
+    visible: values => values.redisMode === 'cluster',
     props: values => ({
       disabled: values?.status === 101,
+      placeholder: '127.0.0.1:6379,127.0.0.1:6378',
     }),
   })
   @I18n('meta.Sources.Redis.ClusterNodes')
@@ -164,17 +128,7 @@ export default class RedisSource
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @I18n('meta.Sources.Redis.MasterName')
-  masterName: string;
-
-  @FieldDecorator({
-    type: 'input',
-    rules: [{ required: true }],
+    visible: values => values.redisMode === 'sentinel',
     props: values => ({
       disabled: values?.status === 101,
     }),
@@ -184,7 +138,7 @@ export default class RedisSource
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
+    visible: values => values.redisMode === 'sentinel',
     props: values => ({
       disabled: values?.status === 101,
     }),
@@ -193,112 +147,46 @@ export default class RedisSource
   additionalKey: string;
 
   @FieldDecorator({
-    type: 'inputnumber',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @I18n('meta.Sources.Redis.Timeout')
-  timeout: number;
-
-  @FieldDecorator({
-    type: 'inputnumber',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @I18n('meta.Sources.Redis.SoTimeout')
-  soTimeout: number;
-
-  @FieldDecorator({
-    type: 'inputnumber',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @I18n('meta.Sources.Redis.MaxTotal')
-  maxTotal: number;
-
-  @FieldDecorator({
-    type: 'inputnumber',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @I18n('meta.Sources.Redis.MaxIdle')
-  maxIdle: number;
-
-  @FieldDecorator({
-    type: 'inputnumber',
-    rules: [{ required: true }],
-    props: values => ({
-      disabled: values?.status === 101,
-    }),
-  })
-  @I18n('meta.Sources.Redis.MinIdle')
-  minIdle: number;
-
-  @FieldDecorator({
-    type: 'radio',
-    rules: [{ required: true }],
-    initialValue: false,
+    type: 'input',
+    visible: values => values.redisMode === 'standalone',
     props: values => ({
       disabled: values?.status === 101,
-      options: [
-        {
-          label: i18n.t('basic.Yes'),
-          value: true,
-        },
-        {
-          label: i18n.t('basic.No'),
-          value: false,
-        },
-      ],
     }),
   })
-  @I18n('meta.Sources.Redis.LookupAsync')
-  lookupAsync: boolean;
+  @ColumnDecorator()
+  @I18n('meta.Sources.Redis.Hostname')
+  host: string;
 
   @FieldDecorator({
     type: 'inputnumber',
-    rules: [{ required: true }],
-    initialValue: 1,
-    visible: record => record.lookupAsync === true,
+    visible: values => values.redisMode === 'standalone',
+    initialValue: 6379,
     props: values => ({
       min: 1,
+      max: 65535,
       disabled: values?.status === 101,
     }),
   })
-  @I18n('meta.Sources.Redis.LookupCacheMaxRows')
-  lookupCacheMaxRows: number;
+  @ColumnDecorator()
+  @I18n('meta.Sources.Redis.Port')
+  port: number;
 
   @FieldDecorator({
-    type: 'inputnumber',
-    rules: [{ required: true }],
-    initialValue: 1,
-    visible: record => record.lookupAsync === true,
+    type: 'input',
     props: values => ({
       disabled: values?.status === 101,
-      min: 1,
     }),
   })
-  @I18n('meta.Sources.Redis.LookupCacheTtl')
-  lookupCacheTtl: number;
+  @I18n('meta.Sources.Redis.PrimaryKey')
+  primaryKey: string;
 
   @FieldDecorator({
     type: 'inputnumber',
-    rules: [{ required: true }],
-    initialValue: 1,
-    visible: record => record.lookupAsync === true,
+    initialValue: 1000,
     props: values => ({
       disabled: values?.status === 101,
-      min: 1,
     }),
   })
-  @I18n('meta.Sources.Redis.LookupMaxRetries')
-  lookupMaxRetries: number;
+  @I18n('meta.Sources.Redis.Timeout')
+  timeout: number;
 }
diff --git a/inlong-dashboard/src/plugins/sources/defaults/SQLServer.ts b/inlong-dashboard/src/plugins/sources/defaults/SQLServer.ts
index ea72ab82f..b33b642af 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/SQLServer.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/SQLServer.ts
@@ -141,7 +141,6 @@ export default class SQLServerSource
 
   @FieldDecorator({
     type: 'input',
-    rules: [{ required: true }],
     props: values => ({
       disabled: values?.status === 101,
     }),