1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00

(trunk web) show pieces info in the inspector

This commit is contained in:
Kevin Glowacz 2009-10-31 02:19:45 +00:00
parent f6c6ebdf70
commit 4cf0d0986a
3 changed files with 10 additions and 1 deletions

View file

@ -80,6 +80,8 @@
<div class="inspector_group">
<div class="inspector_group_label">Information</div>
<div class="inspector_row">
<div class="inspector_label">Pieces:</div>
<div id="torrent_inspector_pieces"></div>
</div>
<div class="inspector_row">
<div class="inspector_label">Hash:</div>

View file

@ -28,7 +28,7 @@ Torrent._ErrTrackerError = 2;
Torrent._ErrLocalError = 3;
Torrent._StaticFields = [ 'addedDate', 'comment', 'creator', 'dateCreated',
'hashString', 'id', 'isPrivate', 'name', 'totalSize' ]
'hashString', 'id', 'isPrivate', 'name', 'totalSize', 'pieceCount', 'pieceSize' ]
Torrent._DynamicFields = [ 'downloadedEver', 'error', 'errorString', 'eta',
'haveUnchecked', 'haveValid', 'leftUntilDone', 'peersConnected',
'peersGettingFromUs', 'peersSendingToUs', 'rateDownload', 'rateUpload',
@ -46,6 +46,8 @@ Torrent.prototype =
this._hashString = data.hashString;
this._date = data.addedDate;
this._size = data.totalSize;
this._pieceCount = data.pieceCount;
this._pieceSize = data.pieceSize;
this._comment = data.comment;
this._creator = data.creator;
this._creator_date = data.dateCreated;

View file

@ -98,6 +98,7 @@ Transmission.prototype =
this._inspector._info_tab.size = $(ti+'size')[0];
this._inspector._info_tab.state = $(ti+'state')[0];
this._inspector._info_tab.swarm_speed = $(ti+'swarm_speed')[0];
this._inspector._info_tab.pieces = $(ti+'pieces')[0];
this._inspector._info_tab.uploaded = $(ti+'uploaded')[0];
this._inspector._info_tab.upload_speed = $(ti+'upload_speed')[0];
this._inspector._info_tab.upload_to = $(ti+'upload_to')[0];
@ -936,6 +937,7 @@ Transmission.prototype =
var total_size = 0;
var total_state = null;
var total_swarm_speed = 0;
var pieces = 'N/A';
var total_upload = 0;
var total_upload_peers = 0;
var total_upload_speed = 0;
@ -949,6 +951,7 @@ Transmission.prototype =
{
setInnerHTML( tab.name, 'No Selection' );
setInnerHTML( tab.size, na );
setInnerHTML( tab.pieces, na );
setInnerHTML( tab.hash, na );
setInnerHTML( tab.state, na );
setInnerHTML( tab.download_speed, na );
@ -989,6 +992,7 @@ Transmission.prototype =
download_dir = t._download_dir;
hash = t.hash();
pieces = t._pieceCount + ', ' + Math.formatBytes(t._pieceSize);
date_created = Math.formatTimestamp( t._creator_date );
}
@ -1022,6 +1026,7 @@ Transmission.prototype =
setInnerHTML( tab.name, name );
setInnerHTML( tab.size, torrents.length ? Math.formatBytes( total_size ) : na );
setInnerHTML( tab.pieces, pieces );
setInnerHTML( tab.hash, hash );
setInnerHTML( tab.state, total_state );
setInnerHTML( tab.download_speed, torrents.length ? Math.formatBytes( total_download_speed ) + '/s' : na );