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 d5f075fcb [INLONG-6904][Dashboard] File source type supports selecting
agent cluster (#6910)
d5f075fcb is described below
commit d5f075fcb26974ca18a4e2ab204c4afc493dc30b
Author: Lizhen <[email protected]>
AuthorDate: Mon Dec 19 09:10:43 2022 +0800
[INLONG-6904][Dashboard] File source type supports selecting agent cluster
(#6910)
---
inlong-dashboard/src/locales/cn.json | 1 +
inlong-dashboard/src/locales/en.json | 1 +
.../src/metas/sources/defaults/File.ts | 30 ++++++++++++++++++++++
3 files changed, 32 insertions(+)
diff --git a/inlong-dashboard/src/locales/cn.json
b/inlong-dashboard/src/locales/cn.json
index 021ef47a3..dc2efe6bc 100644
--- a/inlong-dashboard/src/locales/cn.json
+++ b/inlong-dashboard/src/locales/cn.json
@@ -23,6 +23,7 @@
"meta.Sources.File.IpRule": "请输入正确的IP地址",
"meta.Sources.File.TimeOffset": "时间偏移量",
"meta.Sources.File.TimeOffsetHelp":
"从文件的某个时间开始采集,'1m'表示1分钟之后,'-1m'表示1分钟之前,支持m(分钟),h(小时),d(天),空则从当前时间开始采集",
+ "meta.Sources.File.Cluster": "集群名称",
"meta.Sources.Db.Server": "服务器地址",
"meta.Sources.Db.Port": "服务器端口",
"meta.Sources.Db.ServerTimezone": "服务器时区",
diff --git a/inlong-dashboard/src/locales/en.json
b/inlong-dashboard/src/locales/en.json
index 0e5c22a1c..0f71c1730 100644
--- a/inlong-dashboard/src/locales/en.json
+++ b/inlong-dashboard/src/locales/en.json
@@ -23,6 +23,7 @@
"meta.Sources.File.IpRule": "Please enter the IP address correctly",
"meta.Sources.File.TimeOffset": "Time offset",
"meta.Sources.File.TimeOffsetHelp": "The file will be collected from a
certain time,' 1m' means 1 minute later,' -1m' means 1 minute before, and
m(minute), h(hour), d(day) are supported. If it is empty, the file will be
collected from the current time",
+ "meta.Sources.File.Cluster": "Cluster Name",
"meta.Sources.Db.Server": "Server",
"meta.Sources.Db.Port": "Port",
"meta.Sources.Db.ServerTimezone": "Timezone",
diff --git a/inlong-dashboard/src/metas/sources/defaults/File.ts
b/inlong-dashboard/src/metas/sources/defaults/File.ts
index 212e562a4..edab9791e 100644
--- a/inlong-dashboard/src/metas/sources/defaults/File.ts
+++ b/inlong-dashboard/src/metas/sources/defaults/File.ts
@@ -32,6 +32,36 @@ export default class PulsarSource
extends SourceInfo
implements DataWithBackend, RenderRow, RenderList
{
+ @FieldDecorator({
+ type: 'select',
+ rules: [{ required: true }],
+ props: values => ({
+ showSearch: true,
+ disabled: [110, 130].includes(values?.status),
+ options: {
+ requestTrigger: ['onOpen', 'onSearch'],
+ requestService: {
+ url: '/cluster/list',
+ method: 'POST',
+ data: {
+ type: 'AGENT',
+ pageNum: 1,
+ pageSize: 20,
+ },
+ },
+ requestParams: {
+ formatResult: result =>
+ result?.list?.map(item => ({
+ label: item.name,
+ value: item.name,
+ })),
+ },
+ },
+ }),
+ })
+ @I18n('meta.Sources.File.Cluster')
+ inlongClusterName: string;
+
@FieldDecorator({
type: 'input',
rules: [