(trunk web) progress bar shows seeding progress

This commit is contained in:
Kevin Glowacz 2009-07-28 04:52:59 +00:00
parent 43ae380779
commit 2220a40e84
3 changed files with 38 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 274 B

View File

@ -451,12 +451,6 @@ Torrent.prototype =
}
else
{
// Update the 'in progress' bar
e = root._progress_complete_container;
c = 'torrent_progress_bar';
c += (this.isActive()) ? ' complete' : ' complete_stopped';
e.className = c;
// Create the 'progress details' label
// Eg: '698.05 MB, uploaded 8.59 GB (Ratio: 12.3)'
c = Math.formatBytes( this._size );
@ -466,12 +460,34 @@ Torrent.prototype =
c += Math.round(this._upload_ratio*100)/100;
c += ')';
progress_details = c;
// Hide the 'incomplete' bar
root._progress_incomplete_container.style.display = 'none';
// Set progress to maximum
root._progress_complete_container.style.width = MaxBarWidth + '%';
var status = this.isActive() ? 'complete' : 'complete_stopped';
if(this.isActive() && this.seedRatio() > 0){
status = 'complete seeding'
var seedRatioRatio = this._upload_ratio / this.seedRatio();
var seedRatioPercent = Math.round( seedRatioRatio * 100 * MaxBarWidth ) / 100;
root._progress_incomplete_container.className = 'torrent_progress_bar incomplete seeding'
root._progress_incomplete_container.style.display = 'block';
root._progress_incomplete_container.style.width = seedRatioPercent + '%';
// Set progress to maximum
root._progress_complete_container.style.width = MaxBarWidth - seedRatioPercent + '%';
}
else
{
// Hide the 'incomplete' bar
root._progress_incomplete_container.className = 'torrent_progress_bar incomplete'
root._progress_incomplete_container.style.display = 'none';
// Set progress to maximum
root._progress_complete_container.style.width = MaxBarWidth + '%';
}
// Update the 'in progress' bar
e = root._progress_complete_container;
e.className = 'torrent_progress_bar ' + status;
}
// Update the progress details

View File

@ -427,6 +427,11 @@ ul.torrent_list li.torrent div.torrent_progress_bar.complete {
background-position: left -10px;
border: 1px solid #29AD35;
}
ul.torrent_list li.torrent div.torrent_progress_bar.complete.seeding {
background-position: left -40px;
border: 1px solid #269e30;
border-right: none;
}
ul.torrent_list li.torrent div.torrent_progress_bar.in_progress {
background-position: left 0px;
@ -441,6 +446,11 @@ ul.torrent_list li.torrent div.torrent_progress_bar.incomplete {
border-left: none;
}
ul.torrent_list li.torrent div.torrent_progress_bar.incomplete.seeding {
background-position: left -10px;
border: 1px solid #29AD35;
}
ul.torrent_list li.torrent div.torrent_progress_bar.incomplete_stopped {
background-position: left -30px;
border: 1px solid #939393;