This commit is contained in:
caishi 2021-09-30 15:59:54 +08:00
parent 20c0f76043
commit 11053da351
2 changed files with 17 additions and 4 deletions

View File

@ -189,13 +189,13 @@
flex-wrap: wrap; flex-wrap: wrap;
padding-bottom: 2px; padding-bottom: 2px;
a{ a{
margin: 0px 17px 0px 0px; margin: 0px 17px 10px 0px;
img{ img{
border-radius: 50%; border-radius: 50%;
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
&:nth-child(6){ &:nth-child(5){
margin-right: 0px; margin-right: 0px;
} }
} }

View File

@ -6,20 +6,29 @@ import { Link } from 'react-router-dom';
import { truncateCommitId } from '../../common/util'; import { truncateCommitId } from '../../common/util';
import './Index.scss'; import './Index.scss';
import Tree from '../img/tree.png' import Tree from '../img/tree.png'
import Pagination from 'rc-pagination';
const limit = 15;
function Tags(props) { function Tags(props) {
const [ source , setSource ] = useState([]); const [ source , setSource ] = useState([]);
const [ total ,setTotal ] = useState(0);
const [ page , setPage ] = useState(1);
const { projectsId , owner } = props.match.params; const { projectsId , owner } = props.match.params;
useEffect(() => { useEffect(() => {
if (projectsId) { if (projectsId) {
const url = `/${owner}/${projectsId}/tags.json`; const url = `/${owner}/${projectsId}/tags.json`;
axios.get(url).then((result) => { axios.get(url,{
// params:{
// limit
// }
}).then((result) => {
if (result) { if (result) {
setSource(result.data); setSource(result.data);
setTotal(result.data.total_count);
} }
}).catch(error => {}) }).catch(error => {})
} }
@ -97,6 +106,10 @@ function Tags(props) {
<div> <div>
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/> <SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
<Table className="tagTable" dataSource={source} columns={columns} pagination={false}></Table> <Table className="tagTable" dataSource={source} columns={columns} pagination={false}></Table>
{
total > limit &&
<Pagination current={page} pageSize={limit} onChange={(p)=>setPage(p)}/>
}
</div> </div>
) )
} }