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

aloyszhang 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 76ab7a0a35 [INLONG-11441][Dashboard] Add ClusterTag filtering 
conditions to the cluster interface (#11447)
76ab7a0a35 is described below

commit 76ab7a0a3526b8179cf66b398d402d8cfb13c7c3
Author: kamianlaida <165994047+wohainilao...@users.noreply.github.com>
AuthorDate: Fri Nov 1 15:31:22 2024 +0800

    [INLONG-11441][Dashboard] Add ClusterTag filtering conditions to the 
cluster interface (#11447)
---
 .../src/plugins/sources/common/SourceDefaultInfo.ts       |  9 +++++++++
 inlong-dashboard/src/plugins/sources/defaults/File.ts     |  1 +
 inlong-dashboard/src/plugins/sources/defaults/Kafka.ts    |  1 +
 inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts  |  1 +
 .../src/plugins/sources/defaults/PostgreSQL.ts            |  1 +
 inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts   |  1 +
 .../src/ui/pages/GroupDetail/DataSources/DetailModal.tsx  | 11 ++++++++++-
 .../src/ui/pages/GroupDetail/OperationLog/config.tsx      | 15 +++++++++++++++
 .../src/ui/pages/ModuleAudit/IpModule/index.tsx           |  5 +++++
 9 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts 
b/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts
index 970bd181a7..0c1383af0a 100644
--- a/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts
+++ b/inlong-dashboard/src/plugins/sources/common/SourceDefaultInfo.ts
@@ -96,6 +96,15 @@ export class SourceDefaultInfo implements DataWithBackend, 
RenderRow, RenderList
   @I18n('meta.Sources.Type')
   sourceType: string;
 
+  @FieldDecorator({
+    type: 'select',
+    hidden: true,
+  })
+  @ColumnDecorator()
+  @IngestionField()
+  @I18n('meta.Sources.File.ClusterName')
+  clusterTag: string;
+
   @FieldDecorator({
     type: 'input',
     rules: [
diff --git a/inlong-dashboard/src/plugins/sources/defaults/File.ts 
b/inlong-dashboard/src/plugins/sources/defaults/File.ts
index 81ce7e99d1..e227362eb8 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/File.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/File.ts
@@ -49,6 +49,7 @@ export default class PulsarSource
           data: {
             keyword,
             type: 'AGENT',
+            clusterTag: values.clusterTag,
             pageNum: 1,
             pageSize: 10,
           },
diff --git a/inlong-dashboard/src/plugins/sources/defaults/Kafka.ts 
b/inlong-dashboard/src/plugins/sources/defaults/Kafka.ts
index 1c11b35ab4..7d56aaeb18 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/Kafka.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/Kafka.ts
@@ -48,6 +48,7 @@ export default class KafkaSource
           data: {
             keyword,
             type: 'AGENT',
+            clusterTag: values.clusterTag,
             pageNum: 1,
             pageSize: 10,
           },
diff --git a/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts 
b/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts
index 3f2b614ad2..dae6546316 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/Mongodb.ts
@@ -48,6 +48,7 @@ export default class MongodbSource
           data: {
             keyword,
             type: 'AGENT',
+            clusterTag: values.clusterTag,
             pageNum: 1,
             pageSize: 10,
           },
diff --git a/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts 
b/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts
index bb42c816ab..e3abec09c5 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/PostgreSQL.ts
@@ -48,6 +48,7 @@ export default class PostgreSQLSource
           data: {
             keyword,
             type: 'AGENT',
+            clusterTag: values.clusterTag,
             pageNum: 1,
             pageSize: 10,
           },
diff --git a/inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts 
b/inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts
index 3f3f0bf9c1..3a1a45156a 100644
--- a/inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts
+++ b/inlong-dashboard/src/plugins/sources/defaults/Pulsar.ts
@@ -49,6 +49,7 @@ export default class PulsarSource
           data: {
             keyword,
             type: 'AGENT',
+            clusterTag: values.clusterTag,
             pageNum: 1,
             pageSize: 10,
           },
diff --git 
a/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/DetailModal.tsx 
b/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/DetailModal.tsx
index 4f1675a3d2..4267fc5b83 100644
--- a/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/DetailModal.tsx
+++ b/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/DetailModal.tsx
@@ -60,6 +60,7 @@ const Comp: React.FC<Props> = ({
       formatResult: result => new Entity()?.parse(result) || result,
       onSuccess: result => {
         form.setFieldsValue(result);
+        form.setFieldsValue({ clusterTag: result?.inlongClusterTag });
         setType(result.sourceType);
       },
     },
@@ -89,6 +90,11 @@ const Comp: React.FC<Props> = ({
     message.success(t('pages.GroupDetail.Sources.SaveSuccessfully'));
   };
 
+  const { run: getGroup } = useRequest(`/group/get/${inlongGroupId}`, {
+    onSuccess: result => {
+      form.setFieldsValue({ clusterTag: result?.inlongClusterTag });
+    },
+  });
   useUpdateEffect(() => {
     if (modalProps.open) {
       // open
@@ -118,7 +124,10 @@ const Comp: React.FC<Props> = ({
         <Spin spinning={loading}>
           <FormGenerator
             content={formContent}
-            onValuesChange={(c, values) => setType(values.sourceType)}
+            onValuesChange={(c, values) => {
+              setType(values.sourceType);
+              if (Object.keys(c)[0] === 'sourceType') getGroup();
+            }}
             initialValues={id ? data : { inlongGroupId }}
             form={form}
             useMaxWidth
diff --git a/inlong-dashboard/src/ui/pages/GroupDetail/OperationLog/config.tsx 
b/inlong-dashboard/src/ui/pages/GroupDetail/OperationLog/config.tsx
index 50d558c03d..992f242a95 100644
--- a/inlong-dashboard/src/ui/pages/GroupDetail/OperationLog/config.tsx
+++ b/inlong-dashboard/src/ui/pages/GroupDetail/OperationLog/config.tsx
@@ -87,6 +87,11 @@ export const getFormContent = inlongGroupId => [
             })),
         },
       },
+      allowClear: true,
+      showSearch: true,
+      filterOption: (keyword: string, option: { label: any }) => {
+        return (option?.label ?? 
'').toLowerCase().includes(keyword.toLowerCase());
+      },
     },
   },
   {
@@ -96,6 +101,11 @@ export const getFormContent = inlongGroupId => [
     props: {
       dropdownMatchSelectWidth: false,
       options: targetList,
+      allowClear: true,
+      showSearch: true,
+      filterOption: (keyword: string, option: { label: any }) => {
+        return (option?.label ?? 
'').toLowerCase().includes(keyword.toLowerCase());
+      },
     },
   },
   {
@@ -105,6 +115,11 @@ export const getFormContent = inlongGroupId => [
     props: {
       dropdownMatchSelectWidth: false,
       options: typeList,
+      allowClear: true,
+      showSearch: true,
+      filterOption: (keyword: string, option: { label: any }) => {
+        return (option?.label ?? 
'').toLowerCase().includes(keyword.toLowerCase());
+      },
     },
   },
 ];
diff --git a/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx 
b/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx
index 9342298464..4e56b37ee5 100644
--- a/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx
+++ b/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/index.tsx
@@ -37,6 +37,7 @@ const Comp: React.FC<AuditProps> = ({ auditData }) => {
     startDate: dayjs().startOf('hour').valueOf(),
     endDate: dayjs().startOf('hour').valueOf(),
     auditIds: ['3', '4'],
+    ip: '',
   });
 
   const { data: sourceData = [], run } = useRequest(
@@ -167,6 +168,10 @@ const Comp: React.FC<AuditProps> = ({ auditData }) => {
   const [fileName, setFileName] = useState('ip.csv');
   useEffect(() => {
     setFileName('ip_' + ip + '.csv');
+    setQuery({
+      ...query,
+      ip,
+    });
   }, [ip]);
   return (
     <>

Reply via email to