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 b408d7f166 [INLONG-10086][Dashboard] Add refresh function of module 
audit (#10087)
b408d7f166 is described below

commit b408d7f166d160c109043017c2670db78881a866
Author: haifxu <[email protected]>
AuthorDate: Fri Apr 26 18:52:59 2024 +0800

    [INLONG-10086][Dashboard] Add refresh function of module audit (#10087)
---
 inlong-dashboard/src/ui/locales/cn.json                       |  1 +
 inlong-dashboard/src/ui/locales/en.json                       |  1 +
 inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/config.tsx | 11 ++++++++++-
 inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/index.tsx  | 11 +++++++++--
 inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/config.tsx | 11 ++++++++++-
 5 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/inlong-dashboard/src/ui/locales/cn.json 
b/inlong-dashboard/src/ui/locales/cn.json
index e11a79fb27..831ca63cae 100644
--- a/inlong-dashboard/src/ui/locales/cn.json
+++ b/inlong-dashboard/src/ui/locales/cn.json
@@ -10,6 +10,7 @@
   "basic.Delete": "删除",
   "basic.DeleteConfirm": "确认删除吗?",
   "basic.DeleteSuccess": "删除成功",
+  "basic.Refresh": "刷新",
   "basic.Status": "状态",
   "basic.Creator": "创建人",
   "basic.Modifier": "修改人",
diff --git a/inlong-dashboard/src/ui/locales/en.json 
b/inlong-dashboard/src/ui/locales/en.json
index 90e438b3ff..5b6aa65056 100644
--- a/inlong-dashboard/src/ui/locales/en.json
+++ b/inlong-dashboard/src/ui/locales/en.json
@@ -10,6 +10,7 @@
   "basic.Delete": "Delete",
   "basic.DeleteConfirm": "Are you sure to delete?",
   "basic.DeleteSuccess": "Delete success",
+  "basic.Refresh": "Refresh",
   "basic.Status": "Status",
   "basic.Creator": "Creator",
   "basic.Modifier": "Modifier",
diff --git a/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/config.tsx 
b/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/config.tsx
index 76951a40cc..a9f2a8109c 100644
--- a/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/config.tsx
+++ b/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/config.tsx
@@ -20,6 +20,8 @@
 import dayjs from 'dayjs';
 import i18n from '@/i18n';
 import request from '@/core/utils/request';
+import { Button } from 'antd';
+import React from 'react';
 
 export const timeStaticsDimList = [
   {
@@ -45,7 +47,7 @@ export const toTableData = (source, sourceDataMap) => {
     }));
 };
 
-export const getFormContent = initialValues => [
+export const getFormContent = (initialValues, onSearch) => [
   {
     type: 'select',
     label: i18n.t('pages.ModuleAudit.config.InlongGroupId'),
@@ -178,6 +180,13 @@ export const getFormContent = initialValues => [
       },
     },
   },
+  {
+    type: (
+      <Button type="primary" onClick={onSearch}>
+        {i18n.t('basic.Refresh')}
+      </Button>
+    ),
+  },
 ];
 
 export const getTableColumns = source => {
diff --git a/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/index.tsx 
b/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/index.tsx
index a4fd2513d7..b6fa51a9b6 100644
--- a/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/index.tsx
+++ b/inlong-dashboard/src/ui/pages/ModuleAudit/IdModule/index.tsx
@@ -18,7 +18,7 @@
  */
 
 import React, { useMemo, useState } from 'react';
-import HighTable from '@/ui/components/HighTable';
+import HighTable, { useForm } from '@/ui/components/HighTable';
 import { useRequest } from '@/ui/hooks';
 import { timestampFormat } from '@/core/utils';
 import { getFormContent, toTableData, getTableColumns } from './config';
@@ -26,6 +26,8 @@ import { getFormContent, toTableData, getTableColumns } from 
'./config';
 export const idModule = 'id';
 
 const Comp: React.FC = () => {
+  const [form] = useForm();
+
   const [query, setQuery] = useState({
     startDate: +new Date(),
     endDate: +new Date(),
@@ -75,6 +77,11 @@ const Comp: React.FC = () => {
     return output;
   }, [sourceData]);
 
+  const onSearch = async () => {
+    await form.validateFields();
+    run();
+  };
+
   const onFilter = keyword => {
     setQuery({
       ...query,
@@ -94,7 +101,7 @@ const Comp: React.FC = () => {
     <>
       <HighTable
         filterForm={{
-          content: getFormContent(query),
+          content: getFormContent(query, onSearch),
           onFilter,
         }}
         table={{
diff --git a/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/config.tsx 
b/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/config.tsx
index 98143bdf8c..b54b422e12 100644
--- a/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/config.tsx
+++ b/inlong-dashboard/src/ui/pages/ModuleAudit/IpModule/config.tsx
@@ -20,6 +20,8 @@
 import dayjs from 'dayjs';
 import i18n from '@/i18n';
 import request from '@/core/utils/request';
+import { Button } from 'antd';
+import React from 'react';
 
 export const toChartData = (source, sourceDataMap) => {
   const xAxisData = Object.keys(sourceDataMap);
@@ -56,7 +58,7 @@ export const toTableData = (source, sourceDataMap) => {
 
 export const getFormContent = (initialValues, onSearch) => [
   {
-    type: 'inputsearch',
+    type: 'input',
     label: i18n.t('pages.ModuleAudit.config.Ip'),
     name: 'ip',
   },
@@ -132,6 +134,13 @@ export const getFormContent = (initialValues, onSearch) => 
[
       },
     },
   },
+  {
+    type: (
+      <Button type="primary" onClick={onSearch}>
+        {i18n.t('basic.Refresh')}
+      </Button>
+    ),
+  },
 ];
 
 export const getTableColumns = source => {

Reply via email to