add share ratio in task detail page

master
MaysWind 2016-06-09 17:31:36 +08:00
parent ce853c3ec6
commit a0efe5cde7
4 changed files with 15 additions and 3 deletions

View File

@ -44,6 +44,7 @@
"File Name": "文件名",
"File Size": "大小",
"Completed Percent": "进度",
"Share Ratio": "分享率",
"Remain Time": "剩余时间",
"Download Speed": "下载速度",
"Upload Speed": "上传速度",

View File

@ -48,7 +48,8 @@
'File Name': 'File Name',
'File Size': 'File Size',
'Completed Percent': 'Percent',
'Remain Time': 'Remain',
'Share Ratio': 'Share Ratio',
'Remain Time': 'Remain Time',
'Download Speed': 'Download Speed',
'Upload Speed': 'Upload Speed',
'Overview': 'Overview',

View File

@ -56,6 +56,8 @@
task.completePercent = (task.totalLength > 0 ? task.completedLength / task.totalLength * 100 : 0);
task.remainLength = task.totalLength - task.completedLength;
task.remainPercent = 100 - task.completePercent;
task.uploadLength = (task.uploadLength ? parseInt(task.uploadLength) : 0);
task.shareRatio = (task.uploadLength / task.completedLength);
task.uploadSpeed = parseInt(task.uploadSpeed);
task.downloadSpeed = parseInt(task.downloadSpeed);
@ -153,7 +155,7 @@
},
selectTaskFile: function (gid, selectedFileIndexArr, callback) {
var selectedFileIndex = '';
for (var i = 0; i < selectedFileIndexArr.length; i++) {
if (selectedFileIndex.length > 0) {
selectedFileIndex += ',';
@ -161,7 +163,7 @@
selectedFileIndex += selectedFileIndexArr[i];
}
return this.setTaskOption(gid, 'select-file', selectedFileIndex, callback);
},
getBtTaskPeers: function (gid, callback, silent) {

View File

@ -80,6 +80,14 @@
<span ng-bind="(task.uploadLength | readableVolumn) + (task.status == 'active' ? ' @ ' + (task.uploadSpeed | readableVolumn) + '/s' : '')"></span>
</div>
</div>
<div class="row" ng-if="task && task.bittorrent">
<div class="setting-key col-sm-4">
<span translate>Share Ratio</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="(task.shareRatio | number: 2)"></span>
</div>
</div>
<div class="row" ng-if="task && task.status == 'active' && task.completedLength < task.totalLength">
<div class="setting-key col-sm-4">
<span translate>Remain Time</span>