improve torrent metadata display
This commit is contained in:
@@ -266,7 +266,7 @@ body.drag::before {
|
||||
bottom: 20px;
|
||||
}
|
||||
|
||||
.torrent .status :not(:last-child)::after {
|
||||
.torrent span:not(:last-child)::after {
|
||||
content: ' — ';
|
||||
}
|
||||
|
||||
|
||||
@@ -49,16 +49,18 @@ function renderTorrent (state, dispatch, torrent) {
|
||||
|
||||
// Renders the torrent name and download progress
|
||||
function renderTorrentMetadata (torrent) {
|
||||
var progress = Math.floor(100 * torrent.progress)
|
||||
return hx`
|
||||
<div class="metadata">
|
||||
<div class="name ellipsis">${torrent.name || 'Loading torrent...'}</div>
|
||||
<div class="status">
|
||||
<span class="progress">${Math.floor(100 * torrent.progress)}%</span>
|
||||
<span class="progress">${progress}%</span>
|
||||
<span>${prettyBytes((torrent.length / 100) * progress)} / ${prettyBytes(torrent.length)}</span>
|
||||
</div>
|
||||
${getFilesLength()}
|
||||
<span>${getPeers()}</span>
|
||||
<span>${prettyBytes(torrent.downloadSpeed)}/s</span>
|
||||
<span>${prettyBytes(torrent.uploadSpeed)}/s</span>
|
||||
<span>↓ ${prettyBytes(torrent.downloadSpeed)}/s</span>
|
||||
<span>↑ ${prettyBytes(torrent.uploadSpeed)}/s</span>
|
||||
</div>
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user