Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #12178]Add total record count display in pagination (TotalRender). #12203

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading