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 4e5242413 [INLONG-6772][Dashboard] MySQL sink supports selecting MySQL
nodes (#6801)
4e5242413 is described below
commit 4e5242413c4aab0d67fe2d227542e06f5c1c30bc
Author: Lizhen <[email protected]>
AuthorDate: Mon Dec 12 11:22:36 2022 +0800
[INLONG-6772][Dashboard] MySQL sink supports selecting MySQL nodes (#6801)
---
inlong-dashboard/src/locales/cn.json | 1 +
inlong-dashboard/src/locales/en.json | 1 +
inlong-dashboard/src/metas/nodes/defaults/MySQL.ts | 5 ++-
inlong-dashboard/src/metas/sinks/defaults/MySQL.ts | 51 ++++++++++------------
4 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/inlong-dashboard/src/locales/cn.json
b/inlong-dashboard/src/locales/cn.json
index 16ba0ba58..988b3d771 100644
--- a/inlong-dashboard/src/locales/cn.json
+++ b/inlong-dashboard/src/locales/cn.json
@@ -211,6 +211,7 @@
"meta.Sinks.MySQL.IsMetaField": "是否为元字段",
"meta.Sinks.MySQL.FieldFormat": "字段格式",
"meta.Sinks.MySQL.FieldDescription": "字段描述",
+ "meta.Sinks.MySQL.DataNodeName": "数据节点",
"meta.Sinks.Oracle.TableName": "表名称",
"meta.Sinks.Oracle.PrimaryKey": "主键",
"meta.Sinks.Oracle.FieldName": "字段名",
diff --git a/inlong-dashboard/src/locales/en.json
b/inlong-dashboard/src/locales/en.json
index bbe1abac3..a44cfedc3 100644
--- a/inlong-dashboard/src/locales/en.json
+++ b/inlong-dashboard/src/locales/en.json
@@ -210,6 +210,7 @@
"meta.Sinks.MySQL.IsMetaField": "IsMetaField",
"meta.Sinks.MySQL.FieldFormat": "FieldFormat",
"meta.Sinks.MySQL.FieldDescription": "FieldDescription",
+ "meta.Sinks.MySQL.DataNodeName": "DataNode",
"meta.Sinks.Oracle.TableName": "TableName",
"meta.Sinks.Oracle.PrimaryKey": "PrimaryKey",
"meta.Sinks.Oracle.FieldName": "FieldName",
diff --git a/inlong-dashboard/src/metas/nodes/defaults/MySQL.ts
b/inlong-dashboard/src/metas/nodes/defaults/MySQL.ts
index be6feb65f..d8bf75ec7 100644
--- a/inlong-dashboard/src/metas/nodes/defaults/MySQL.ts
+++ b/inlong-dashboard/src/metas/nodes/defaults/MySQL.ts
@@ -34,7 +34,7 @@ export default class MySQLNode extends NodeInfo implements
DataWithBackend, Rend
username: string;
@FieldDecorator({
- type: 'input',
+ type: 'password',
rules: [{ required: true }],
})
@I18n('meta.Nodes.MySQL.Password')
@@ -43,6 +43,9 @@ export default class MySQLNode extends NodeInfo implements
DataWithBackend, Rend
@FieldDecorator({
type: 'input',
rules: [{ required: true }],
+ props: {
+ placeholder: 'jdbc:mysql://127.0.0.1:3306/write',
+ },
})
@I18n('meta.Nodes.MySQL.Url')
url: string;
diff --git a/inlong-dashboard/src/metas/sinks/defaults/MySQL.ts
b/inlong-dashboard/src/metas/sinks/defaults/MySQL.ts
index 0960ed616..c4f2df323 100644
--- a/inlong-dashboard/src/metas/sinks/defaults/MySQL.ts
+++ b/inlong-dashboard/src/metas/sinks/defaults/MySQL.ts
@@ -63,18 +63,6 @@ const fieldTypes = Object.keys(fieldTypesConf).reduce(
);
export default class HiveSink extends SinkInfo implements DataWithBackend,
RenderRow, RenderList {
- @FieldDecorator({
- type: 'input',
- rules: [{ required: true }],
- props: values => ({
- disabled: [110, 130].includes(values?.status),
- placeholder: 'jdbc:mysql://127.0.0.1:3306/write',
- }),
- })
- @ColumnDecorator()
- @I18n('JDBC URL')
- jdbcUrl: string;
-
@FieldDecorator({
type: 'input',
rules: [{ required: true }],
@@ -120,26 +108,35 @@ export default class HiveSink extends SinkInfo implements
DataWithBackend, Rende
enableCreateResource: number;
@FieldDecorator({
- type: 'input',
- rules: [{ required: true }],
- props: values => ({
- disabled: [110, 130].includes(values?.status),
- }),
- })
- @ColumnDecorator()
- @I18n('meta.Sinks.Username')
- username: string;
-
- @FieldDecorator({
- type: 'password',
+ type: 'select',
rules: [{ required: true }],
props: values => ({
+ showSearch: true,
disabled: [110, 130].includes(values?.status),
+ options: {
+ requestTrigger: ['onSearch'],
+ requestService: keyword => ({
+ url: '/node/list',
+ method: 'POST',
+ data: {
+ keyword,
+ type: 'MYSQL',
+ pageNum: 1,
+ pageSize: 20,
+ },
+ }),
+ requestParams: {
+ formatResult: result =>
+ result?.list?.map(item => ({
+ label: item.name,
+ value: item.name,
+ })),
+ },
+ },
}),
})
- @ColumnDecorator()
- @I18n('meta.Sinks.Password')
- password: string;
+ @I18n('meta.Sinks.MySQL.DataNodeName')
+ dataNodeName: string;
@FieldDecorator({
type: EditableTable,