mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-04 09:05:34 -05:00
webui: added transfer rate
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8398 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e1fbd77d80
commit
a28543708d
@ -126,7 +126,8 @@ void TransfersHandler::handleDownloads(Request &req, Response &resp)
|
|||||||
double size = fi.size;
|
double size = fi.size;
|
||||||
double transfered = fi.transfered;
|
double transfered = fi.transfered;
|
||||||
stream << makeKeyValueReference("size", size)
|
stream << makeKeyValueReference("size", size)
|
||||||
<< makeKeyValueReference("transfered", transfered);
|
<< makeKeyValueReference("transfered", transfered)
|
||||||
|
<< makeKeyValue("transfer_rate", fi.tfRate);
|
||||||
|
|
||||||
std::string dl_status;
|
std::string dl_status;
|
||||||
/*
|
/*
|
||||||
|
@ -457,7 +457,7 @@ function makeFriendlyUnit(bytes)
|
|||||||
{
|
{
|
||||||
if(bytes < 1e3)
|
if(bytes < 1e3)
|
||||||
return bytes.toFixed(1) + "B";
|
return bytes.toFixed(1) + "B";
|
||||||
if(bytes < 1e3)
|
if(bytes < 1e6)
|
||||||
return (bytes/1e3).toFixed(1) + "kB";
|
return (bytes/1e3).toFixed(1) + "kB";
|
||||||
if(bytes < 1e9)
|
if(bytes < 1e9)
|
||||||
return (bytes/1e6).toFixed(1) + "MB";
|
return (bytes/1e6).toFixed(1) + "MB";
|
||||||
@ -532,6 +532,7 @@ var DownloadsWidget = React.createClass({
|
|||||||
<td>{this.props.data.name}</td>
|
<td>{this.props.data.name}</td>
|
||||||
<td>{makeFriendlyUnit(this.props.data.size)}</td>
|
<td>{makeFriendlyUnit(this.props.data.size)}</td>
|
||||||
<td><ProgressBar progress={this.props.data.transfered / this.props.data.size}/></td>
|
<td><ProgressBar progress={this.props.data.transfered / this.props.data.size}/></td>
|
||||||
|
<td>{makeFriendlyUnit(this.props.data.transfer_rate*1e3)}/s</td>
|
||||||
<td>{this.props.data.download_status}</td>
|
<td>{this.props.data.download_status}</td>
|
||||||
<td>{ctrlBtn} <div className="btn" onClick={cancelFn}>cancel</div> {playBtn}</td>
|
<td>{ctrlBtn} <div className="btn" onClick={cancelFn}>cancel</div> {playBtn}</td>
|
||||||
</tr>);
|
</tr>);
|
||||||
@ -543,6 +544,7 @@ var DownloadsWidget = React.createClass({
|
|||||||
<th>name</th>
|
<th>name</th>
|
||||||
<th>size</th>
|
<th>size</th>
|
||||||
<th>completed</th>
|
<th>completed</th>
|
||||||
|
<th>transfer rate</th>
|
||||||
<th>download status</th>
|
<th>download status</th>
|
||||||
<th>actions</th>
|
<th>actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -457,7 +457,7 @@ function makeFriendlyUnit(bytes)
|
|||||||
{
|
{
|
||||||
if(bytes < 1e3)
|
if(bytes < 1e3)
|
||||||
return bytes.toFixed(1) + "B";
|
return bytes.toFixed(1) + "B";
|
||||||
if(bytes < 1e3)
|
if(bytes < 1e6)
|
||||||
return (bytes/1e3).toFixed(1) + "kB";
|
return (bytes/1e3).toFixed(1) + "kB";
|
||||||
if(bytes < 1e9)
|
if(bytes < 1e9)
|
||||||
return (bytes/1e6).toFixed(1) + "MB";
|
return (bytes/1e6).toFixed(1) + "MB";
|
||||||
@ -532,6 +532,7 @@ var DownloadsWidget = React.createClass({
|
|||||||
<td>{this.props.data.name}</td>
|
<td>{this.props.data.name}</td>
|
||||||
<td>{makeFriendlyUnit(this.props.data.size)}</td>
|
<td>{makeFriendlyUnit(this.props.data.size)}</td>
|
||||||
<td><ProgressBar progress={this.props.data.transfered / this.props.data.size}/></td>
|
<td><ProgressBar progress={this.props.data.transfered / this.props.data.size}/></td>
|
||||||
|
<td>{makeFriendlyUnit(this.props.data.transfer_rate*1e3)}/s</td>
|
||||||
<td>{this.props.data.download_status}</td>
|
<td>{this.props.data.download_status}</td>
|
||||||
<td>{ctrlBtn} <div className="btn" onClick={cancelFn}>cancel</div> {playBtn}</td>
|
<td>{ctrlBtn} <div className="btn" onClick={cancelFn}>cancel</div> {playBtn}</td>
|
||||||
</tr>);
|
</tr>);
|
||||||
@ -543,6 +544,7 @@ var DownloadsWidget = React.createClass({
|
|||||||
<th>name</th>
|
<th>name</th>
|
||||||
<th>size</th>
|
<th>size</th>
|
||||||
<th>completed</th>
|
<th>completed</th>
|
||||||
|
<th>transfer rate</th>
|
||||||
<th>download status</th>
|
<th>download status</th>
|
||||||
<th>actions</th>
|
<th>actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user