sorting
This commit is contained in:
parent
85472ffc17
commit
25a59b6b39
1 changed files with 1 additions and 169 deletions
|
|
@ -152,153 +152,6 @@ const TorrentList = ({ setisTorrent, torrent_list, runtime }) => {
|
|||
|
||||
|
||||
|
||||
const columns = [
|
||||
|
||||
{
|
||||
|
||||
name: 'Name',
|
||||
|
||||
selector: row => row.name,
|
||||
|
||||
sortable: true,
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Action',
|
||||
cell: (row, index) => {
|
||||
|
||||
let slug = row?.name.toLowerCase().trim().replace(/[^\w\s-]/g, '').replace(/[\s_-]+/g, '-').replace(/^-+|-+$/g, '');
|
||||
|
||||
|
||||
|
||||
return (
|
||||
|
||||
<a onClick={() => router.push(`/post-detail/${row?.eid}/${slug}/`)}>
|
||||
|
||||
Download
|
||||
|
||||
</a>
|
||||
|
||||
)
|
||||
|
||||
},
|
||||
|
||||
width: "10%",
|
||||
|
||||
style: {
|
||||
|
||||
color: "#296ac8",
|
||||
|
||||
cursor: "pointer",
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
name: 'Category',
|
||||
|
||||
selector: row => row.category_str,
|
||||
|
||||
width: "10%",
|
||||
|
||||
sortable: true,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
name: 'Date',
|
||||
|
||||
selector: row => moment(row?.last_checked).format("DD-MM-YYYY"),
|
||||
|
||||
width: "10%",
|
||||
|
||||
sortable: true,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
name: 'Runtime',
|
||||
|
||||
selector: row => moment.utc(runtime * 1000).format('HH:mm:ss'),
|
||||
|
||||
width: "11%",
|
||||
|
||||
sortable: true,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
name: 'Size',
|
||||
|
||||
selector: row => formatBytes(row?.size),
|
||||
|
||||
sortable: true,
|
||||
|
||||
width: "10%",
|
||||
|
||||
sortFunction: (a, b) => {
|
||||
|
||||
|
||||
|
||||
return a.size - b.size;
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
name: 'S',
|
||||
|
||||
selector: row => row?.seeders,
|
||||
|
||||
sortable: true,
|
||||
|
||||
width: "6%",
|
||||
|
||||
style: {
|
||||
|
||||
color: "#00FF00",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
name: 'L',
|
||||
|
||||
selector: row => row.leechers,
|
||||
|
||||
sortable: true,
|
||||
|
||||
width: "6%",
|
||||
|
||||
style: {
|
||||
|
||||
color: "#dd0c0e",
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
createTheme('dark', {
|
||||
|
||||
background: {
|
||||
|
|
@ -311,28 +164,7 @@ const TorrentList = ({ setisTorrent, torrent_list, runtime }) => {
|
|||
|
||||
|
||||
|
||||
const customCss = {
|
||||
|
||||
|
||||
|
||||
headCells: {
|
||||
|
||||
style: {
|
||||
|
||||
fontSize: "14px",
|
||||
|
||||
fontWeight: "700",
|
||||
|
||||
color: "#C2D8D3"
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue