You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/03/17 22:54:57 UTC
[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1584: feat: save Service list page's meta status
liuxiran commented on a change in pull request #1584:
URL: https://github.com/apache/apisix-dashboard/pull/1584#discussion_r596437219
##########
File path: web/src/pages/Service/List.tsx
##########
@@ -30,6 +31,17 @@ const Page: React.FC = () => {
const { formatMessage } = useIntl();
const [rawDataEditorVisible, setRawDataEditorVisible] = useState(false);
const [rawData, setRawData] = useState({});
+ const [paginationConfig, setPaginationConfig] = useState({ pageSize: 10, current: 1 });
+
+ const savePageList = (page: number, pageSize?: number) => {
+ history.replace(`/service/list?page=${page}&pageSize=${pageSize}`);
+ };
+
+ useEffect(() => {
+ const { page = 1, pageSize = 10 } = querystring.parse(window.location.search);
+ setPaginationConfig({ pageSize: Number(pageSize), current: Number(page) });
+ fetchList({ current: Number(page), pageSize: Number(pageSize) });
Review comment:
in line112 we already have a `fetchlist` request, it would be better to remove this manually call to avoid call fetchlist twice
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org