Changing scrape column to tooltip. Fixes #8"

This commit is contained in:
Dessalines 2018-10-24 11:18:47 -07:00
parent dbe5fa16d3
commit c29f7959ed
3 changed files with 36 additions and 32 deletions

View File

@ -1,5 +1,7 @@
# Torrents.csv # Torrents.csv
<!-- Torrents.csv - An open source, collaborative repository of torrents, with a self-hostable web server. -->
`Torrents.csv` is a collaborative, *vetted* repository of torrents, consisting of a single, searchable `torrents.csv` file. Its initially populated with a January 2017 backup of the pirate bay, and new torrents are periodically added from various torrents sites via a rust script. `Torrents.csv` is a collaborative, *vetted* repository of torrents, consisting of a single, searchable `torrents.csv` file. Its initially populated with a January 2017 backup of the pirate bay, and new torrents are periodically added from various torrents sites via a rust script.
`Torrents.csv` will only store torrents with at least one seeder to keep the file small, and will be periodically purged of non-seeded torrents, and sorted by seeders descending. `Torrents.csv` will only store torrents with at least one seeder to keep the file small, and will be periodically purged of non-seeded torrents, and sorted by seeders descending.

View File

@ -11,9 +11,9 @@
"author": "Dominic Gannaway", "author": "Dominic Gannaway",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"classcat": "^1.1.3",
"inferno": "^6.0.3", "inferno": "^6.0.3",
"moment": "^2.22.2", "moment": "^2.22.2"
"classcat": "^1.1.3"
}, },
"devDependencies": { "devDependencies": {
"fuse-box": "^3.1.3", "fuse-box": "^3.1.3",

View File

@ -76,37 +76,39 @@ class TorrentSearchComponent extends Component<any, State> {
table() { table() {
return ( return (
<div class="table-responsive-sm"> <div>
<table class="table table-hover"> <div class="table-responsive-sm">
<thead> <table class="table table-hover">
<tr> <thead>
<th>Name</th>
<th class="text-right">Size</th>
<th class="text-right">Seeds</th>
<th class="text-right">Leeches</th>
<th>Created</th>
<th>Scraped</th>
<th></th>
</tr>
</thead>
<tbody>
{this.state.results.torrents.map(torrent => (
<tr> <tr>
<td>{torrent.name}</td> <th>Name</th>
<td class="text-right">{humanFileSize(torrent.size_bytes, true)}</td> <th class="text-right">Size</th>
<td class="text-right">{torrent.seeders}</td> <th class="text-right">Seeds</th>
<td class="text-right">{torrent.leechers}</td> <th class="text-right">Leeches</th>
<td>{moment(torrent.created_unix * 1000).fromNow()}</td> <th>Created</th>
<td>{moment(torrent.scraped_date * 1000).fromNow()}</td> <th></th>
<td class="text-right">
<a href={magnetLink(torrent.infohash)}>
<i class="fas fa-magnet"></i>
</a>
</td>
</tr> </tr>
))} </thead>
</tbody> <tbody>
</table> {this.state.results.torrents.map(torrent => (
<tr>
<td>{torrent.name}</td>
<td class="text-right">{humanFileSize(torrent.size_bytes, true)}</td>
<td class="text-right">{torrent.seeders}</td>
<td class="text-right">{torrent.leechers}</td>
<td title={`Scraped ${moment(torrent.scraped_date * 1000).fromNow()}`}>
{moment(torrent.created_unix * 1000).fromNow()}
</td>
<td class="text-right">
<a href={magnetLink(torrent.infohash)}>
<i class="fas fa-magnet"></i>
</a>
</td>
</tr>
))}
</tbody>
</table>
</div>
{this.paginator()} {this.paginator()}
</div> </div>
); );