display order supports by file size
This commit is contained in:
parent
ec77ab9c20
commit
3042489c06
|
@ -66,19 +66,25 @@
|
|||
</li>
|
||||
<li>
|
||||
<a class="pointer-cursor" ng-click="changeDisplayOrder('name')">
|
||||
<span translate>File Name</span>
|
||||
<span translate>By File Name</span>
|
||||
<i class="fa" ng-class="{'fa-check': isSetDisplayOrder('name')}"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="pointer-cursor" ng-click="changeDisplayOrder('size')">
|
||||
<span translate>By File Size</span>
|
||||
<i class="fa" ng-class="{'fa-check': isSetDisplayOrder('size')}"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="pointer-cursor" ng-click="changeDisplayOrder('percent')">
|
||||
<span translate>Completed Percent</span>
|
||||
<span translate>By Completed Percent</span>
|
||||
<i class="fa" ng-class="{'fa-check': isSetDisplayOrder('percent')}"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="pointer-cursor" ng-click="changeDisplayOrder('remain')">
|
||||
<span translate>Remain Time</span>
|
||||
<span translate>By Remain Time</span>
|
||||
<i class="fa" ng-class="{'fa-check': isSetDisplayOrder('remain')}"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -29,7 +29,9 @@
|
|||
};
|
||||
|
||||
var processDownloadTask = function (task) {
|
||||
var remainLength = task.totalLength - task.completedLength;
|
||||
var totalLength = parseInt(task.totalLength);
|
||||
var completedLength = parseInt(task.completedLength);
|
||||
var remainLength = totalLength - completedLength;
|
||||
|
||||
if (task.bittorrent && task.bittorrent.info) {
|
||||
task.taskName = task.bittorrent.info.name;
|
||||
|
@ -39,7 +41,8 @@
|
|||
task.taskName = translateFilter('Unknown');
|
||||
}
|
||||
|
||||
task.completePercent = task.completedLength / task.totalLength * 100;
|
||||
task.fileSize = totalLength;
|
||||
task.completePercent = completedLength / totalLength * 100;
|
||||
task.idle = task.downloadSpeed == 0;
|
||||
task.remainTime = calculateDownloadRemainTime(remainLength, task.downloadSpeed);
|
||||
};
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
if (type == 'name') {
|
||||
return orderByFilter(array, ['taskName'], false);
|
||||
} else if (type == 'size') {
|
||||
return orderByFilter(array, ['fileSize'], false);
|
||||
} else if (type == 'percent') {
|
||||
return orderByFilter(array, ['completePercent'], true);
|
||||
} else if (type == 'remain') {
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
'Delete': 'Delete',
|
||||
'Display Order': 'Display Order',
|
||||
'Default': 'Default',
|
||||
'File Name': 'File Name',
|
||||
'Completed Percent': 'Completed Percent',
|
||||
'Remain Time': 'Remain Time',
|
||||
'By File Name': 'By File Name',
|
||||
'By File Size': 'By File Size',
|
||||
'By Completed Percent': 'By Completed Percent',
|
||||
'By Remain Time': 'By Remain Time',
|
||||
'Settings': 'Settings',
|
||||
'Download': 'Download',
|
||||
'Downloading': 'Downloading',
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
'Delete': '删除下载任务',
|
||||
'Display Order': '显示顺序',
|
||||
'Default': '默认',
|
||||
'File Name': '文件名',
|
||||
'Completed Percent': '完成度',
|
||||
'Remain Time': '剩余时间',
|
||||
'By File Name': '按文件名',
|
||||
'By File Size': '按文件大小',
|
||||
'By Completed Percent': '按完成度',
|
||||
'By Remain Time': '按剩余时间',
|
||||
'Settings': '系统设置',
|
||||
'Download': '下载',
|
||||
'Downloading': '正在下载',
|
||||
|
|
Reference in a new issue