Skip to content

Commit

Permalink
Add total record count display in pagination (TotalRender). (alibaba#…
Browse files Browse the repository at this point in the history
  • Loading branch information
HMYDK authored Jun 17, 2024
1 parent cd8e858 commit e192e25
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
8 changes: 8 additions & 0 deletions console-ui/src/components/Page/TotalRender.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

const TotalRender = ({ total, range }) => {
// const [start, end] = range;
return <span>总数 : {total}</span>;
};

export default TotalRender;
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import QueryResult from '../../../components/QueryResult';

import './index.scss';
import { LANGUAGE_KEY, GLOBAL_PAGE_SIZE_LIST, LOGINPAGE_ENABLED } from '../../../constants';
import TotalRender from '../../../components/Page/TotalRender';

const { Item } = MenuButton;
const { Panel } = Collapse;
Expand Down Expand Up @@ -1405,6 +1406,7 @@ class ConfigurationManagement extends React.Component {
onPageSizeChange={val => this.handlePageSizeChange(val)}
current={configurations.pageNumber}
total={configurations.totalCount}
totalRender={(total, range) => <TotalRender total={total} range={range} />}
pageSize={this.state.pageSize}
onChange={this.changePage.bind(this)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import RegionGroup from '../../../components/RegionGroup';
import EditServiceDialog from '../ServiceDetail/EditServiceDialog';
import ShowServiceCodeing from 'components/ShowCodeing/ShowServiceCodeing';
import PageTitle from '../../../components/PageTitle';
import TotalRender from '../../../components/Page/TotalRender';

import './ServiceList.scss';
import { GLOBAL_PAGE_SIZE_LIST } from '../../../constants';
Expand Down Expand Up @@ -343,6 +344,7 @@ class ServiceList extends React.Component {
popupProps={{ align: 'bl tl' }}
total={this.state.total}
pageSize={this.state.pageSize}
totalRender={(total, range) => <TotalRender total={total} range={range} />}
onPageSizeChange={pageSize => this.handlePageSizeChange(pageSize)}
onChange={currentPage => this.setState({ currentPage }, () => this.queryServiceList())}
/>
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?d71f900fb2dcffde12ce" rel="stylesheet"></head>
<link href="./css/main.css?dfa5340ca3e297239923" rel="stylesheet"></head>

<body>
<div id="root" style="overflow:hidden"></div>
Expand All @@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?d71f900fb2dcffde12ce"></script></body>
<script type="text/javascript" src="./js/main.js?dfa5340ca3e297239923"></script></body>

</html>
28 changes: 14 additions & 14 deletions console/src/main/resources/static/js/main.js

Large diffs are not rendered by default.

0 comments on commit e192e25

Please sign in to comment.