From b408d7f166d160c109043017c2670db78881a866 Mon Sep 17 00:00:00 2001 From: haifxu Date: Fri, 26 Apr 2024 18:52:59 +0800 Subject: [PATCH] [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 + .../src/ui/pages/ModuleAudit/IdModule/config.tsx | 11 ++++++++++- .../src/ui/pages/ModuleAudit/IdModule/index.tsx | 11 +++++++++-- .../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 e11a79fb276..831ca63caea 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 90e438b3ff0..5b6aa65056b 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 76951a40cc2..a9f2a8109c5 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: ( + + ), + }, ]; 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 a4fd2513d7f..b6fa51a9b68 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 = () => { <> { 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: ( + + ), + }, ]; export const getTableColumns = source => {