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 9767a7c8d [INLONG-7005][Dashboard] Support starrocks node management (#7008) 9767a7c8d is described below commit 9767a7c8d5511b6985c58f860786047690238ce0 Author: Lizhen <88174078+bluew...@users.noreply.github.com> AuthorDate: Wed Dec 21 15:57:54 2022 +0800 [INLONG-7005][Dashboard] Support starrocks node management (#7008) --- inlong-dashboard/src/locales/cn.json | 4 ++ inlong-dashboard/src/locales/en.json | 4 ++ .../src/metas/nodes/defaults/StarRocks.ts | 67 ++++++++++++++++++++++ inlong-dashboard/src/metas/nodes/defaults/index.ts | 5 ++ .../src/metas/sinks/defaults/StarRocks.ts | 63 ++++++++------------ 5 files changed, 104 insertions(+), 39 deletions(-) diff --git a/inlong-dashboard/src/locales/cn.json b/inlong-dashboard/src/locales/cn.json index 89c6256c9..7f3dceedb 100644 --- a/inlong-dashboard/src/locales/cn.json +++ b/inlong-dashboard/src/locales/cn.json @@ -292,6 +292,7 @@ "meta.Sinks.HBase.IsMetaField": "是否为元字段", "meta.Sinks.HBase.FieldFormat": "字段格式", "meta.Sinks.HBase.FieldDescription": "字段描述", + "meta.Sinks.StarRocks.DataNodeName": "数据节点", "meta.Sinks.StarRocks.TableName": "表名称", "meta.Sinks.StarRocks.PrimaryKey": "主键", "meta.Sinks.StarRocks.DatabaseName": "数据库名", @@ -418,6 +419,9 @@ "meta.Nodes.ClickHouse.Username": "用户名", "meta.Nodes.ClickHouse.Password": "密码", "meta.Nodes.ClickHouse.Url": "地址", + "meta.Nodes.StarRocks.Username": "用户名", + "meta.Nodes.StarRocks.Password": "密码", + "meta.Nodes.StarRocks.Url": "地址", "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 73594640e..12e448f9f 100644 --- a/inlong-dashboard/src/locales/en.json +++ b/inlong-dashboard/src/locales/en.json @@ -292,6 +292,7 @@ "meta.Sinks.HBase.IsMetaField": "IsMetaField", "meta.Sinks.HBase.FieldFormat": "FieldFormat", "meta.Sinks.HBase.FieldDescription": "FieldDescription", + "meta.Sinks.StarRocks.DataNodeName": "DataNode", "meta.Sinks.StarRocks.TableName": "TableName", "meta.Sinks.StarRocks.PrimaryKey": "PrimaryKey", "meta.Sinks.StarRocks.DatabaseName": "Database Name", @@ -415,6 +416,9 @@ "meta.Nodes.Iceberg.Url": "URL", "meta.Nodes.Iceberg.Warehouse": "Warehouse", "meta.Nodes.Iceberg.CatalogType": "Catalog Type", + "meta.Nodes.StarRocks.Username": "Username", + "meta.Nodes.StarRocks.Password": "Password", + "meta.Nodes.StarRocks.Url": "URL", "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/StarRocks.ts b/inlong-dashboard/src/metas/nodes/defaults/StarRocks.ts new file mode 100644 index 000000000..0a49b5a51 --- /dev/null +++ b/inlong-dashboard/src/metas/nodes/defaults/StarRocks.ts @@ -0,0 +1,67 @@ +/* + * 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 StarRocksNode + extends NodeInfo + implements DataWithBackend, RenderRow, RenderList +{ + @FieldDecorator({ + type: 'input', + rules: [{ required: true }], + }) + @I18n('meta.Nodes.StarRocks.Username') + username: string; + + @FieldDecorator({ + type: 'password', + rules: [{ required: true }], + }) + @I18n('meta.Nodes.StarRocks.Password') + token: string; + + @FieldDecorator({ + type: 'input', + rules: [{ required: true }], + props: values => ({ + disabled: [110, 130].includes(values?.status), + placeholder: 'jdbc:mysql://127.0.0.1:3306/write', + }), + }) + @I18n('meta.Nodes.StarRocks.Url') + url: string; + + @FieldDecorator({ + type: 'input', + rules: [{ required: true }], + props: values => ({ + disabled: [110, 130].includes(values?.status), + placeholder: '127.0.0.1:8030;127.0.0.1:8031;127.0.0.1:8032;', + }), + }) + @I18n('LOAD URL') + loadUrl: string; +} diff --git a/inlong-dashboard/src/metas/nodes/defaults/index.ts b/inlong-dashboard/src/metas/nodes/defaults/index.ts index e6e5610cb..cb455292e 100644 --- a/inlong-dashboard/src/metas/nodes/defaults/index.ts +++ b/inlong-dashboard/src/metas/nodes/defaults/index.ts @@ -51,4 +51,9 @@ export const allDefaultNodes: MetaExportWithBackendList<NodeMetaType> = [ value: 'MYSQL', LoadEntity: () => import('./MySQL'), }, + { + label: 'StarRocks', + value: 'STARROCKS', + LoadEntity: () => import('./StarRocks'), + }, ]; diff --git a/inlong-dashboard/src/metas/sinks/defaults/StarRocks.ts b/inlong-dashboard/src/metas/sinks/defaults/StarRocks.ts index 7ff0e7091..c0fde2545 100644 --- a/inlong-dashboard/src/metas/sinks/defaults/StarRocks.ts +++ b/inlong-dashboard/src/metas/sinks/defaults/StarRocks.ts @@ -61,50 +61,35 @@ export default class StarRocksSink 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 }], - props: values => ({ - disabled: [110, 130].includes(values?.status), - placeholder: '127.0.0.1:8030;127.0.0.1:8031;127.0.0.1:8032;', - }), - }) - @ColumnDecorator() - @I18n('LOAD URL') - loadUrl: string; - - @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: ['onOpen', 'onSearch'], + requestService: keyword => ({ + url: '/node/list', + method: 'POST', + data: { + keyword, + type: 'STARROCKS', + 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.StarRocks.DataNodeName') + dataNodeName: string; @FieldDecorator({ type: 'input',