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 e620e845d [INLONG-8078][Dashboard] Fix the Source and sink list 
pagination does not work (#8079)
e620e845d is described below

commit e620e845d6752d6632e64e91fa591c31239b6dea
Author: Lizhen <[email protected]>
AuthorDate: Thu May 25 14:19:26 2023 +0800

    [INLONG-8078][Dashboard] Fix the Source and sink list pagination does not 
work (#8079)
---
 .../src/ui/pages/GroupDetail/DataSources/index.tsx        | 15 +++++++++++++--
 .../src/ui/pages/GroupDetail/DataStorage/index.tsx        | 15 +++++++++++++--
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/index.tsx 
b/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/index.tsx
index 1a936fb35..e1050f61d 100644
--- a/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/index.tsx
+++ b/inlong-dashboard/src/ui/pages/GroupDetail/DataSources/index.tsx
@@ -18,7 +18,7 @@
  */
 
 import React, { useState, forwardRef, useMemo, useCallback } from 'react';
-import { Badge, Button, Card, Modal, List, Tag, Segmented, message } from 
'antd';
+import { Badge, Button, Card, Modal, List, Tag, Segmented, message, 
PaginationProps } from 'antd';
 import { PaginationConfig } from 'antd/lib/pagination';
 import {
   UnorderedListOutlined,
@@ -160,6 +160,10 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly }: 
Props, ref) => {
     }));
   }, []);
 
+  const onChangeList: PaginationProps['onChange'] = page => {
+    setOptions({ pageSize: defaultSize, pageNum: page, sourceType: 
defaultValue });
+  };
+
   const pagination: PaginationConfig = {
     pageSize: options.pageSize,
     current: options.pageNum,
@@ -275,7 +279,14 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly }: 
Props, ref) => {
             size="small"
             loading={loading}
             dataSource={data?.list as Record<string, any>[]}
-            pagination={pagination}
+            pagination={{
+              pageSize: defaultSize,
+              current: options.pageNum,
+              total: data?.total,
+              simple: true,
+              size: 'small',
+              onChange: onChangeList,
+            }}
             renderItem={item => (
               <List.Item
                 actions={[
diff --git a/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/index.tsx 
b/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/index.tsx
index 27f14fbee..b91cac850 100644
--- a/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/index.tsx
+++ b/inlong-dashboard/src/ui/pages/GroupDetail/DataStorage/index.tsx
@@ -18,7 +18,7 @@
  */
 
 import React, { useState, useMemo, forwardRef, useCallback } from 'react';
-import { Badge, Button, Card, Modal, List, Tag, Segmented, message } from 
'antd';
+import { Badge, Button, Card, Modal, List, Tag, Segmented, message, 
PaginationProps } from 'antd';
 import { PaginationConfig } from 'antd/lib/pagination';
 import {
   UnorderedListOutlined,
@@ -119,6 +119,10 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly }: 
Props, ref) => {
     }));
   };
 
+  const onChangeList: PaginationProps['onChange'] = page => {
+    setOptions({ pageSize: defaultSize, pageNum: page, sinkType: defaultValue 
});
+  };
+
   const pagination: PaginationConfig = {
     pageSize: options.pageSize,
     current: options.pageNum,
@@ -217,7 +221,14 @@ const Comp = ({ inlongGroupId, inlongStreamId, readonly }: 
Props, ref) => {
             size="small"
             loading={loading}
             dataSource={data?.list as Record<string, any>[]}
-            pagination={pagination}
+            pagination={{
+              pageSize: defaultSize,
+              current: options.pageNum,
+              total: data?.total,
+              simple: true,
+              size: 'small',
+              onChange: onChangeList,
+            }}
             renderItem={item => (
               <List.Item
                 actions={[

Reply via email to