Permalink
Browse files

show speed in UI

  • Loading branch information...
1 parent 3978294 commit 7a02944dcf847eab0595265c02113ba118ccde6d @feross feross committed Feb 25, 2014
Showing with 9 additions and 4 deletions.
  1. +1 −0 README.md
  2. +4 −0 lib/app.js
  3. +3 −3 package.json
  4. +1 −1 views/torrent.html
View
@@ -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)
View
@@ -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) {
View
@@ -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": [
@@ -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"
}
-}
+}
View
@@ -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.