You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Baoyuantop (via GitHub)" <gi...@apache.org> on 2025/12/16 06:55:30 UTC
Re: [PR] feat: add route search form with 9 filter fields [apisix-dashboard]
Baoyuantop commented on code in PR #3222:
URL: https://github.com/apache/apisix-dashboard/pull/3222#discussion_r2622035704
##########
src/components/form/Editor.tsx:
##########
@@ -16,7 +16,7 @@
*/
import { InputWrapper, type InputWrapperProps, Skeleton } from '@mantine/core';
import { Editor } from '@monaco-editor/react';
-import { clsx } from 'clsx';
Review Comment:
Why modify this part?
##########
src/routes/routes/index.tsx:
##########
@@ -16,20 +16,30 @@
*/
import type { ProColumns } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components';
+import { useQuery } from '@tanstack/react-query';
import { createFileRoute } from '@tanstack/react-router';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { getRouteListQueryOptions, useRouteList } from '@/apis/hooks';
import type { WithServiceIdFilter } from '@/apis/routes';
+import { getRouteListReq } from '@/apis/routes';
+import { SearchForm, type SearchFormValues } from '@/components/form/SearchForm';
import { DeleteResourceBtn } from '@/components/page/DeleteResourceBtn';
import PageHeader from '@/components/page/PageHeader';
import { ToAddPageBtn, ToDetailPageBtn } from '@/components/page/ToAddPageBtn';
import { AntdConfigProvider } from '@/config/antdConfigProvider';
-import { API_ROUTES } from '@/config/constant';
+import { API_ROUTES, PAGE_SIZE_MAX } from '@/config/constant';
Review Comment:
1. If the backend supports a larger page_size, consider increasing it appropriately, or implement a loop-based pagination system on the frontend to retrieve all data (performance needs to be considered).
2. If retrieving all data is not feasible at the moment, a prompt should be provided in the UI informing the user to "search only in the first 500 records".
##########
src/routes/routes/index.tsx:
##########
@@ -16,20 +16,30 @@
*/
import type { ProColumns } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components';
+import { useQuery } from '@tanstack/react-query';
import { createFileRoute } from '@tanstack/react-router';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { getRouteListQueryOptions, useRouteList } from '@/apis/hooks';
import type { WithServiceIdFilter } from '@/apis/routes';
+import { getRouteListReq } from '@/apis/routes';
+import { SearchForm, type SearchFormValues } from '@/components/form/SearchForm';
import { DeleteResourceBtn } from '@/components/page/DeleteResourceBtn';
import PageHeader from '@/components/page/PageHeader';
import { ToAddPageBtn, ToDetailPageBtn } from '@/components/page/ToAddPageBtn';
import { AntdConfigProvider } from '@/config/antdConfigProvider';
-import { API_ROUTES } from '@/config/constant';
+import { API_ROUTES, PAGE_SIZE_MAX } from '@/config/constant';
Review Comment:
If we use the PAGE_SIZE_MAX limit, then we should clearly inform the user of this limit in the functional area.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org