Skip to content

Commit

Permalink
show speed in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Feb 25, 2014
1 parent 3978294 commit 7a02944
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Most of the active development is happening inside of smaller npm modules which
- [chrome-dgram](https://github.com/feross/chrome-dgram)
- [chrome-portfinder](https://github.com/feross/chrome-portfinder)
- [magnet-uri](https://github.com/feross/magnet-uri)
- [parse-torrent](https://github.com/feross/parse-torrent)
- [bittorrent-protocol](https://github.com/feross/bittorrent-protocol)
- [bittorrent-swarm](https://github.com/feross/bittorrent-swarm)
- [bittorrent-dht](https://github.com/feross/bittorrent-dht) (work-in-progress)
Expand Down
4 changes: 4 additions & 0 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ App.prototype.updateTorrentUI = function ($torrent, torrent) {
$torrent.find('progress').attr('value', torrent.progress)
$torrent.find('.numPeers').text(torrent.swarm.numConns + torrent.swarm.numQueued)
$torrent.find('.numActivePeers').text(torrent.swarm.numPeers)
$torrent.find('.downloadSpeed')
.text(humanize.filesize(torrent.swarm.downloadSpeed()))
$torrent.find('.uploadSpeed')
.text(humanize.filesize(torrent.swarm.uploadSpeed()))
}

App.prototype.downloadTorrentMetadata = function (torrent) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
"speedometer": "^0.1.2"
},
"devDependencies": {
"brfs": "^0.2.2",
"browserify": "3.x",
"browserify-shim": "^3.2.2",
"nib": "^1.0.2",
"nodemon": "^1.0.15",
"stylus": "^0.42.2",
"tape": "2.x",
"watchify": "0.x",
"brfs": "^0.2.2"
"watchify": "0.x"
},
"homepage": "http://webtorrent.io",
"keywords": [
Expand Down Expand Up @@ -77,4 +77,4 @@
"watch-css": "stylus --use nib css/main.styl --out chrome/ --watch",
"watch-js": "watchify index.js --outfile chrome/bundle.js --debug --verbose"
}
}
}
2 changes: 1 addition & 1 deletion views/torrent.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>
<progress max="1" value="0"></progress>
<div class="stats2">
Downloading from <span class="numActivePeers"></span> of <span class="numPeers"></span> peers - UL: 0.0 KB/s
Downloading from <span class="numActivePeers"></span> of <span class="numPeers"></span> peers - DL: <span class="downloadSpeed"></span>/s UL: <span class="uploadSpeed"></span>/s
</div>
</div>
</section>

0 comments on commit 7a02944

Please sign in to comment.