better approximation of byte progress
This commit is contained in:
@@ -49,13 +49,12 @@ function renderTorrent (state, dispatch, torrent) {
|
|||||||
|
|
||||||
// Renders the torrent name and download progress
|
// Renders the torrent name and download progress
|
||||||
function renderTorrentMetadata (torrent) {
|
function renderTorrentMetadata (torrent) {
|
||||||
var progress = Math.floor(100 * torrent.progress)
|
|
||||||
return hx`
|
return hx`
|
||||||
<div class="metadata">
|
<div class="metadata">
|
||||||
<div class="name ellipsis">${torrent.name || 'Loading torrent...'}</div>
|
<div class="name ellipsis">${torrent.name || 'Loading torrent...'}</div>
|
||||||
<div class="status">
|
<div class="status">
|
||||||
<span class="progress">${progress}%</span>
|
<span class="progress">${Math.floor(100 * torrent.progress)}%</span>
|
||||||
<span>${prettyBytes((torrent.length / 100) * progress)} / ${prettyBytes(torrent.length)}</span>
|
<span>${prettyBytes(torrent.length * torrent.progress)} / ${prettyBytes(torrent.length)}</span>
|
||||||
</div>
|
</div>
|
||||||
${getFilesLength()}
|
${getFilesLength()}
|
||||||
<span>${getPeers()}</span>
|
<span>${getPeers()}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user