Merge pull request #17 from Luminarys/master

Tweak file list and torrent table
This commit is contained in:
Drew DeVault 2017-11-12 14:33:28 -05:00 committed by GitHub
commit 7f17d52428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -34,9 +34,13 @@ function File({ file }) {
return ( return (
<tr> <tr>
<td> <td>
<a href={dlURI(uri, password, file.id)} target="_new"> {
{file.path} file.progress == 1.0
</a> ? <a href={dlURI(uri, password, file.id)} target="_new">
{file.path}
</a>
: file.path
}
</td> </td>
<td>{file.priority}</td> <td>{file.priority}</td>
<td>{file.availability}</td> <td>{file.availability}</td>
@ -176,7 +180,7 @@ class Torrent extends Component {
<CardBlock> <CardBlock>
<table className="table table-striped" style={{marginBottom: "0"}}> <table className="table table-striped" style={{marginBottom: "0"}}>
<tbody> <tbody>
{files.map(file => <File file={file} />)} {files.slice().sort((a, b) => a.path.localeCompare(b.path)).map(file => <File file={file} />)}
</tbody> </tbody>
</table> </table>
</CardBlock> </CardBlock>

View File

@ -33,7 +33,7 @@ class TorrentTable extends Component {
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{Object.values(torrents).map(t => {Object.values(torrents).slice().sort((a, b) => a.name.localeCompare(b.name)).map(t =>
<tr <tr
key={t.id} key={t.id}
className={`torrent ${ className={`torrent ${