This repository has been archived on 2022-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
AriaNg/app/views/task-detail.html
2016-06-11 21:55:17 +08:00

246 lines
15 KiB
HTML

<section class="content no-padding">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li ng-class="{'active': context.currentTab == 'overview'}">
<a class="pointer-cursor" ng-click="context.currentTab = 'overview'" translate>Overview</a>
</li>
<li ng-class="{'active': context.currentTab == 'blocks'}">
<a class="pointer-cursor" ng-click="context.currentTab = 'blocks'" translate>Blocks</a>
</li>
<li ng-class="{'active': context.currentTab == 'filelist'}">
<a class="pointer-cursor" ng-click="context.currentTab = 'filelist'" translate>Files</a>
</li>
<li ng-class="{'active': context.currentTab == 'btpeers'}" ng-if="task && task.status == 'active' && task.bittorrent">
<a class="pointer-cursor" ng-click="context.currentTab = 'btpeers';" translate>Peers</a>
</li>
<li ng-class="{'active': context.currentTab == 'settings'}" ng-if="task && (task.status == 'active' || task.status == 'waiting' || task.status == 'paused')" class="slim">
<a class="pointer-cursor" ng-click="context.currentTab = 'settings';loadTaskOption(task);">
<i class="fa fa-gear"></i>
</a>
</li>
</ul>
<div class="tab-content no-padding">
<div class="tab-pane" ng-class="{'active': context.currentTab == 'overview'}">
<div class="settings-table settings-table-firstrow-noborder">
<div class="row">
<div class="setting-key col-sm-4">
<span translate>File Name</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="task.taskName"></span>
</div>
</div>
<div class="row" ng-if="task">
<div class="setting-key col-sm-4">
<span translate>File Size</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="task.totalLength | readableVolumn"></span>
<span ng-if="task.files" ng-bind="('format.settings.file-count' | translate: {count: task.files.length})"></span>
</div>
</div>
<div class="row" ng-if="task">
<div class="setting-key col-sm-4">
<span translate>Task Status</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="task | taskStatus | translate: {errorcode: task.errorCode}"></span>
</div>
</div>
<div class="row" ng-if="task && task.status == 'error' && task.errorMessage">
<div class="setting-key col-sm-4">
<span translate>Error Description</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="task.errorMessage"></span>
</div>
</div>
<div class="row" ng-if="task">
<div class="setting-key col-sm-4">
<span ng-bind="('Completed Percent' | translate) + (task.status == 'active' && task.bittorrent ? ' (' + ('Health Percent' | translate) + ')' : '')"></span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="(task.completePercent | percent: 2) + '%' + (task.status == 'active' && task.bittorrent ? ' (' + (context.healthPercent | percent: 2) + '%' + ')' : '')"></span>
</div>
</div>
<div class="row" ng-if="task">
<div class="setting-key col-sm-4">
<span translate>Download</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="(task.completedLength | readableVolumn) + (task.status == 'active' ? ' @ ' + (task.downloadSpeed | readableVolumn) + '/s' : '')"></span>
</div>
</div>
<div class="row" ng-if="task && task.bittorrent">
<div class="setting-key col-sm-4">
<span translate>Upload</span>
</div>
<div class="setting-value col-sm-8">
<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>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="0 <= task.remainTime && task.remainTime < 86400? (task.remainTime | dateDuration: 'second': 'HH:mm:ss') : ('More Than One Day' | translate)"></span>
</div>
</div>
<div class="row" ng-if="task && task.infoHash">
<div class="setting-key col-sm-4">
<span translate>Info Hash</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="task.infoHash"></span>
</div>
</div>
<div class="row" ng-if="task && task.status == 'active'">
<div class="setting-key col-sm-4">
<span ng-bind="(task.bittorrent ? ('Seeders' | translate) + ' / ' : '') + ('Connections' | translate)">Connections</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="(task.numSeeders ? (task.numSeeders + ' / ') : '') + task.connections"></span>
</div>
</div>
<div class="row" ng-if="task">
<div class="setting-key col-sm-4">
<span translate>Download Dir</span>
</div>
<div class="setting-value col-sm-8">
<span ng-bind="task.dir"></span>
</div>
</div>
<div class="row no-hover no-background" ng-if="task && task.status == 'active'">
<div class="col-sm-12">
<div class="task-status-chart-wrapper">
<ng-chart ng-data="context.statusData" height="200"></ng-chart>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" ng-class="{'active': context.currentTab == 'blocks'}">
<div class="piece-legends">
<div class="piece-legend">
<div class="piece piece-completed"></div>
<span translate>Completed</span>
</div>
<div class="piece-legend">
<div class="piece"></div>
<span translate>Uncompleted</span>
</div>
</div>
<ng-piece-map bit-field="task.bitfield" piece-count="task.numPieces"></ng-piece-map>
</div>
<div class="tab-pane" ng-class="{'active': context.currentTab == 'filelist'}">
<div class="task-table task-table-firstrow-noborder">
<div class="task-table-title hidden-xs">
<div class="row">
<div class="col-sm-8">
<a ng-click="changeFileListDisplayOrder('name:asc', true)" translate>File Name</a>
<i class="fa" ng-class="{'fa-sort-asc fa-order-asc': isSetFileListDisplayOrder('name:asc'), 'fa-sort-desc fa-order-desc': isSetFileListDisplayOrder('name:desc')}"></i>
</div>
<div class="col-sm-2">
<a ng-click="changeFileListDisplayOrder('percent:desc', true)" translate>Completed Percent</a>
<i class="fa" ng-class="{'fa-sort-asc fa-order-asc': isSetFileListDisplayOrder('percent:asc'), 'fa-sort-desc fa-order-desc': isSetFileListDisplayOrder('percent:desc')}"></i>
</div>
<div class="col-sm-2">
<a ng-click="changeFileListDisplayOrder('size:asc', true)" translate>File Size</a>
<i class="fa" ng-class="{'fa-sort-asc fa-order-asc': isSetFileListDisplayOrder('size:asc'), 'fa-sort-desc fa-order-desc': isSetFileListDisplayOrder('size:desc')}"></i>
</div>
</div>
</div>
<div class="task-table-body">
<div class="row" ng-repeat="file in task.files | fileOrderBy: getFileListOrderType()" data-file-index="{{file.index}}">
<div class="col-sm-8">
<div class="checkbox checkbox-primary">
<input id="{{'file_' + file.index}}" type="checkbox" ng-disabled="!task || !task.files || task.files.length < 2 || (task.status != 'waiting' && task.status != 'paused')"
ng-model="file.selected" ng-change="setSelectedFile()"/>
<label for="{{'file_' + file.index}}" ng-bind="file.fileName"></label>
</div>
</div>
<div class="col-sm-2">
<div class="progress">
<div class="progress-bar progress-bar-primary" role="progressbar"
aria-valuenow="{{file.completePercent}}" aria-valuemin="1"
aria-valuemax="100" ng-style="{ width: file.completePercent + '%' }">
<span ng-class="{'progress-lower': file.completePercent < 50}"
ng-bind="(file.completePercent | percent: 2) + '%'"></span>
</div>
</div>
</div>
<div class="col-sm-2">
<span class="task-size" ng-bind="file.length | readableVolumn"></span>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" ng-class="{'active': context.currentTab == 'btpeers'}" ng-if="task && task.status == 'active' && task.bittorrent">
<div class="task-table task-table-firstrow-noborder">
<div class="task-table-title hidden-xs">
<div class="row">
<div class="col-sm-3">
<span translate>Address</span>
</div>
<div class="col-sm-3">
<span translate>Status</span>
</div>
<div class="col-sm-2 col-xs-4">
<span translate>Percent</span>
</div>
<div class="col-sm-4 col-xs-4">
<span translate>Download / Upload Speed</span>
</div>
</div>
</div>
<div class="task-table-body">
<div class="row" ng-repeat="peer in peers">
<div class="col-sm-3">
<span ng-bind="peer.ip + ':' + peer.port"></span>
</div>
<div class="col-sm-3">
<div class="piece-bar-wrapper">
<ng-piece-bar bit-field="peer.bitfield" piece-count="task.numPieces" color="#149BDF"></ng-piece-bar>
</div>
</div>
<div class="col-sm-2 col-xs-4">
<span ng-bind="(peer.completePercent | percent: 2) + '%'"></span>
</div>
<div class="col-sm-4 col-xs-8">
<div class="task-peer-download-speed">
<i class="icon-download fa fa-arrow-down"></i>
<span ng-bind="(peer.downloadSpeed | readableVolumn) + '/s'"></span>&nbsp;
<i class="icon-upload fa fa-arrow-up"></i>
<span ng-bind="(peer.uploadSpeed | readableVolumn) + '/s'"></span>
</div>
</div>
</div>
<div class="row" ng-if="!peers || peers.length < 1">
<div class="col-sm-12 text-center">
<span translate>No connected peers</span>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" ng-class="{'active': context.currentTab == 'settings'}" ng-if="task && (task.status == 'active' || task.status == 'waiting' || task.status == 'paused')">
<div class="settings-table settings-table-firstrow-noborder">
<ng-setting ng-repeat="option in context.availableOptions" option="option"
ng-model="options[option.key]" on-change-value="setOption(key, value, optionStatus)"></ng-setting>
</div>
</div>
</div>
</div><!-- /.nav-tabs-custom -->
</section>