Skip to content

Commit

Permalink
fix: Modify pagination and Personal access tokens without token displ…
Browse files Browse the repository at this point in the history
…ay (#268)

feat: Modify pagination and Personal access tokens without token display
  • Loading branch information
Liam-Zhao committed Aug 21, 2023
1 parent 89267ff commit 832f1cd
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 158 deletions.
28 changes: 16 additions & 12 deletions src/components/clusters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { createTheme, ThemeProvider } from '@mui/material/styles';
import MoreTimeIcon from '@mui/icons-material/MoreTime';
import ArrowCircleRightIcon from '@mui/icons-material/ArrowCircleRight';
import { useNavigate } from 'react-router-dom';
import { DEFAULT_PAGE_SIZE ,MAX_PAGE_SIZE} from '../../lib/constants';
import { DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE } from '../../lib/constants';

const theme = createTheme({
breakpoints: {
Expand Down Expand Up @@ -409,17 +409,21 @@ export default function Clusters() {
</Box>
))}
</Grid>
<Box display="flex" justifyContent="flex-end" sx={{ marginTop: theme.spacing(2) }}>
<Pagination
count={totalPages}
page={page}
onChange={(_event: any, newPage: number) => {
setPage(newPage);
}}
color="primary"
size="small"
/>
</Box>
{totalPages > 1 ? (
<Box display="flex" justifyContent="flex-end" sx={{ marginTop: theme.spacing(2) }}>
<Pagination
count={totalPages}
page={page}
onChange={(_event: any, newPage: number) => {
setPage(newPage);
}}
color="primary"
size="small"
/>
</Box>
) : (
<></>
)}
</ThemeProvider>
</Box>
);
Expand Down
52 changes: 30 additions & 22 deletions src/components/clusters/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -864,17 +864,21 @@ export default function ShowCluster() {
</LoadingButton>
</DialogActions>
</Dialog>
<Box display="flex" justifyContent="flex-end" sx={{ marginTop: theme.spacing(2) }}>
<Pagination
count={schedulerTotalPages}
page={schedulerPage}
onChange={(_event: any, newPage: number) => {
setSchedulerPage(newPage);
}}
color="primary"
size="small"
/>
</Box>
{schedulerTotalPages > 1 ? (
<Box display="flex" justifyContent="flex-end" sx={{ marginTop: theme.spacing(2) }}>
<Pagination
count={schedulerTotalPages}
page={schedulerPage}
onChange={(_event: any, newPage: number) => {
setSchedulerPage(newPage);
}}
color="primary"
size="small"
/>
</Box>
) : (
<></>
)}
<Typography variant="subtitle1" gutterBottom fontFamily="mabry-bold" mt="2rem" mb="1rem">
Seed Peer Cluster
</Typography>
Expand Down Expand Up @@ -1138,17 +1142,21 @@ export default function ShowCluster() {
</LoadingButton>
</DialogActions>
</Dialog>
<Box display="flex" justifyContent="flex-end" sx={{ marginTop: theme.spacing(2) }}>
<Pagination
count={seedPeerTotalPages}
page={seedPeerPage}
onChange={(_event: any, newPage: number) => {
setSeedPeerPage(newPage);
}}
color="primary"
size="small"
/>
</Box>
{seedPeerTotalPages > 1 ? (
<Box display="flex" justifyContent="flex-end" sx={{ marginTop: theme.spacing(2) }}>
<Pagination
count={seedPeerTotalPages}
page={seedPeerPage}
onChange={(_event: any, newPage: number) => {
setSeedPeerPage(newPage);
}}
color="primary"
size="small"
/>
</Box>
) : (
<></>
)}
<Grid sx={{ height: 2 }}> </Grid>
</ThemeProvider>
);
Expand Down
Loading

0 comments on commit 832f1cd

Please sign in to comment.