Jelajahi Sumber

merge https://github.com/mayswind/AriaNg/commit/3950c7a528ded1e086237cfd41b24b12cf2af6cb

MaysWind 6 tahun lalu
induk
melakukan
f95ee8627e

+ 1 - 0
app/langs/zh_Hans.txt

@@ -306,6 +306,7 @@ requires.aria2-version=需要 aria2 v{{version}} 或更高版本
 task.new.download-links=下载链接 ({{count}} 个链接):
 task.pieceinfo=已完成: {{completed}}, 共计: {{total}} 块
 task.error-occurred=发生错误 ({{errorcode}})
+task.verifying-percent=正在验证 ({{verifiedPercent}}%)
 settings.file-count=({{count}} 个文件)
 settings.total-count=(共计: {{count}}个)
 debug.latest-logs=最近 {{count}} 条日志

+ 1 - 0
app/langs/zh_Hant.txt

@@ -306,6 +306,7 @@ requires.aria2-version=需要 aria2 v{{version}} 或更高版本
 task.new.download-links=下載連結 ({{count}} 个連結):
 task.pieceinfo=已完成: {{completed}}, 共計: {{total}} 塊
 task.error-occurred=發生錯誤 ({{errorcode}})
+task.verifying-percent=正在驗證 ({{verifiedPercent}}%)
 settings.file-count=({{count}} 個檔案)
 settings.total-count=(共計: {{count}}個)
 debug.latest-logs=最近 {{count}} 條記錄

+ 1 - 0
app/scripts/config/defaultLanguage.js

@@ -310,6 +310,7 @@
                 'task.new.download-links': 'Download Links ({{count}} Links):',
                 'task.pieceinfo': 'Completed: {{completed}}, Total: {{total}}',
                 'task.error-occurred': 'Error Occurred ({{errorcode}})',
+                'task.verifying-percent': 'Verifying ({{verifiedPercent}}%)',
                 'settings.file-count': '({{count}} Files)',
                 'settings.total-count': '(Total Count: {{count}})',
                 'debug.latest-logs': 'Latest {{count}} Logs'

+ 1 - 1
app/scripts/filters/taskStatus.js

@@ -11,7 +11,7 @@
                 if (task.verifyIntegrityPending) {
                     return 'Pending Verification';
                 } else if (task.verifiedLength) {
-                    return 'Verifying';
+                    return (task.verifiedPercent ? 'format.task.verifying-percent' : 'Verifying');
                 } else if (task.seeder === true || task.seeder === 'true') {
                     return 'Seeding';
                 } else {

+ 6 - 0
app/scripts/services/aria2TaskService.js

@@ -294,6 +294,12 @@
             task.remainTime = calculateDownloadRemainTime(task.remainLength, task.downloadSpeed);
             task.seeder = (task.seeder === true || task.seeder === 'true');
 
+            if (task.verifiedLength && task.totalLength) {
+                task.verifiedPercent = parseInt(task.verifiedLength / task.totalLength * 100);
+            } else {
+                task.verifiedPercent = undefined;
+            }
+
             var taskNameResult = getTaskName(task);
             task.taskName = taskNameResult.name;
             task.hasTaskName = taskNameResult.success;

+ 2 - 2
app/views/list.html

@@ -65,13 +65,13 @@
                         <span class="task-last-time"
                               ng-bind="task.status === 'waiting' ? '--:--:--' : (task.status === 'paused' ? '' : (task.status === 'active' ? ((0 <= task.remainTime && task.remainTime < 86400) ? (task.remainTime | dateDuration: 'second': 'HH:mm:ss') : ('More Than One Day' | translate)) : ''))"></span>
                         <span class="task-download-speed visible-xs-inline pull-right"
-                              ng-bind="(task.status === 'active' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode}))"></span>
+                              ng-bind="(task.status === 'active' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode, verifiedPercent: task.verifiedPercent}))"></span>
                         <span class="task-seeders pull-right" ng-bind="task.status === 'active' ? ((task.numSeeders ? (task.numSeeders + '/') : '') + task.connections) : ''"></span>
                     </div>
                 </div>
                 <div class="col-md-2 col-sm-2 hidden-xs">
                     <span class="task-download-speed" title="{{task.status === 'active' ? (('Download Speed' | translate) + ': ' + (task.downloadSpeed | readableVolume) + '/s') + (task.bittorrent ? ', ' + ('Upload Speed' | translate) + ': ' + (task.uploadSpeed | readableVolume) + '/s' : '') : ''}}"
-                          ng-bind="(task.status === 'active' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode}))"></span>
+                          ng-bind="(task.status === 'active' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode, verifiedPercent: task.verifiedPercent}))"></span>
                 </div>
                 <div class="task-right-arrow visible-md visible-lg">
                     <a ng-href="#!/task/detail/{{task.gid}}" title="{{'Click to view task detail' | translate}}">

+ 1 - 1
app/views/task-detail.html

@@ -48,7 +48,7 @@
                             <span translate>Task Status</span>
                         </div>
                         <div class="setting-value col-sm-8">
-                            <span ng-bind="task | taskStatus | translate: {errorcode: task.errorCode}"></span>
+                            <span ng-bind="task | taskStatus | translate: {errorcode: task.errorCode, verifiedPercent: task.verifiedPercent}"></span>
                             <i class="icon-primary fa fa-question-circle" ng-if="task.errorCode && task.errorCode != '0' && task.errorMessage"
                                   ng-tooltip="{{task.errorMessage}}" ng-tooltip-container="body" ng-tooltip-placement="top"></i>
                         </div>