Merge pull request #1 from ziahamza/master

Updating my repo
This commit is contained in:
jdarias 2016-05-01 22:17:01 -05:00
commit ba37fd360e
5 changed files with 37 additions and 19 deletions

View File

@ -255,7 +255,7 @@
<a <a
ng-click="changeLanguage('fr_FR')" ng-click="changeLanguage('fr_FR')"
href="#"><span class="fa fa-fw flag-icon flag-icon-fr">&nbsp;</span> Français</a> href="#"><span class="fa fa-fw flag-icon flag-icon-fr">&nbsp;</span> Français</a>
</li> </li>
<li> <li>
<a <a
ng-click="changeLanguage('de_DE')" ng-click="changeLanguage('de_DE')"
@ -545,7 +545,7 @@
<ul class="stats pull-left" ng-switch-when="paused"> <ul class="stats pull-left" ng-switch-when="paused">
<!-- {{{ paused download statistics --> <!-- {{{ paused download statistics -->
<li class="label label-info"> <li class="label label-info">
<span title="{{ 'Download Status' | translate }}"><span class="fa fa-fw fa-pause">&nbsp;</span> {{download.status}}</span> <span title="{{ 'Download status' | translate }}"><span class="fa fa-fw fa-pause">&nbsp;</span> {{download.status}}</span>
</li> </li>
<li class="label label-info"> <li class="label label-info">
@ -588,7 +588,7 @@
<!-- {{{ complete download statistics --> <!-- {{{ complete download statistics -->
<li class="label label-success"> <li class="label label-success">
<span title="{{ 'Download Status' | translate }}"><span class="fa fa-fw fa-check-square-o">&nbsp;</span> {{download.status}}</span> <span title="{{ 'Download status' | translate }}"><span class="fa fa-fw fa-check-square-o">&nbsp;</span> {{download.status}}</span>
</li> </li>
<li class="label label-success"> <li class="label label-success">
@ -605,7 +605,7 @@
<ul class="stats pull-left" ng-switch-when="removed"> <ul class="stats pull-left" ng-switch-when="removed">
<!-- {{{ removed download statistics --> <!-- {{{ removed download statistics -->
<li class="label label-warning"> <li class="label label-warning">
<span title="{{ 'Download Status' | translate }}"><span class="fa fa-fw fa-times">&nbsp;</span> {{download.status}}</span> <span title="{{ 'Download status' | translate }}"><span class="fa fa-fw fa-times">&nbsp;</span> {{download.status}}</span>
</li> </li>
<li class="label label-warning"> <li class="label label-warning">
@ -650,7 +650,7 @@
<canvas bitfield="download.bitfield" draw="!download.collapsed" pieces="download.numPieces" class="progress chunk-canvas" width="1400" chunkbar></canvas> <canvas bitfield="download.bitfield" draw="!download.collapsed" pieces="download.numPieces" class="progress chunk-canvas" width="1400" chunkbar></canvas>
</div> </div>
<ul class="stats download-item"> <ul class="stats download-item">
<li class="label label-default" title="{{ 'Estimated Time' | translate }}"><i class="fa fa-fw fa-clock-o">&nbsp;</i> <span class="download-eta">{{getEta(download) | time}}</span></li> <li class="label label-default" title="{{ 'Estimated time' | translate }}"><i class="fa fa-fw fa-clock-o">&nbsp;</i> <span class="download-eta">{{getEta(download) | time}}</span></li>
<li class="label label-default" title="{{ 'Download Size' | translate }}"><i class="fa fa-fw fa-cloud-download">&nbsp;</i> <span class="download-totalLength">{{download.fmtTotalLength}}</span></li> <li class="label label-default" title="{{ 'Download Size' | translate }}"><i class="fa fa-fw fa-cloud-download">&nbsp;</i> <span class="download-totalLength">{{download.fmtTotalLength}}</span></li>
<li class="label label-default" title="{{ 'Downloaded' | translate }}"><i class="fa fa-fw fa-download">&nbsp;</i> <span class="download-completedLength">{{download.fmtCompletedLength}}</span></li> <li class="label label-default" title="{{ 'Downloaded' | translate }}"><i class="fa fa-fw fa-download">&nbsp;</i> <span class="download-completedLength">{{download.fmtCompletedLength}}</span></li>
<li class="label label-default" title="{{ 'Download Speed' | translate }}"><i class="fa fa-fw fa-arrow-circle-o-down">&nbsp;</i> <span class="download-downloadSpeed">{{download.fmtDownloadSpeed}}</span></li> <li class="label label-default" title="{{ 'Download Speed' | translate }}"><i class="fa fa-fw fa-arrow-circle-o-down">&nbsp;</i> <span class="download-downloadSpeed">{{download.fmtDownloadSpeed}}</span></li>
@ -790,7 +790,7 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4 --out=file2.mp4
<p class="help-block"> <p class="help-block">
{{ '- Select the torrent from the local filesystem to start the download.' | translate }}<br /> {{ '- Select the torrent from the local filesystem to start the download.' | translate }}<br />
{{ '- You can select multiple torrents to start multiple downloads.' | translate }}<br /> {{ '- You can select multiple torrents to start multiple downloads.' | translate }}<br />
{{ '- To add a BitTorrent-Magnet URL, use the add URI option and add it there.' | translate }} {{ '- To add a BitTorrent-Magnet URL, use the Add By URI option and add it there.' | translate }}
</p> </p>
<div class="form-horizontal form-group"> <div class="form-horizontal form-group">
<label class="control-label" style="text-align: left;"><b>{{ 'Select a Torrent' | translate }}:</b></label> <label class="control-label" style="text-align: left;"><b>{{ 'Select a Torrent' | translate }}:</b></label>
@ -1086,7 +1086,7 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4 --out=file2.mp4
ng-model="connection.conf.directURL"/> ng-model="connection.conf.directURL"/>
<p class="help-block"> <p class="help-block">
{{ 'If supplied, links will be created to enable direct download from the Aria2 server.' | translate }}<br /> {{ 'If supplied, links will be created to enable direct download from the Aria2 server.' | translate }}<br />
{{ '(Requires an appropriate webserver to be configured.)' | translate }} {{ '(Requires appropriate webserver to be configured.)' | translate }}
</p> </p>
</div> </div>
</div> </div>
@ -1137,7 +1137,7 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4 --out=file2.mp4
{{ 'To download the latest version of the project, add issues or to contribute back, head on to' | translate }}:<br /> {{ 'To download the latest version of the project, add issues or to contribute back, head on to' | translate }}:<br />
<a href="https://github.com/ziahamza/webui-aria2">http://github.com/ziahamza/webui-aria2</a> <a href="https://github.com/ziahamza/webui-aria2">http://github.com/ziahamza/webui-aria2</a>
<br /><br /> <br /><br />
{{ 'Or you can open the latest version in browser through' | translate }}:<br /> {{ 'Or you can open the latest version in the browser through' | translate }}:<br />
<a href="http://ziahamza.github.io/webui-aria2">http://ziahamza.github.io/webui-aria2</a> <a href="http://ziahamza.github.io/webui-aria2">http://ziahamza.github.io/webui-aria2</a>
</p> </p>
</div> </div>

View File

@ -5,8 +5,8 @@ angular
]) ])
.factory('$rpc', [ .factory('$rpc', [
'$syscall', '$globalTimeout', '$alerts', '$utils', '$syscall', '$globalTimeout', '$alerts', '$utils',
'$rootScope', '$location', '$authconf', '$rootScope', '$location', '$authconf', '$filter',
function(syscall, globalTimeout, alerts, utils, rootScope, uri, authconf) { function(syscall, globalTimeout, alerts, utils, rootScope, uri, authconf, filter) {
var subscriptions = [] var subscriptions = []
, configurations = [authconf] , configurations = [authconf]
@ -102,11 +102,13 @@ function(syscall, globalTimeout, alerts, utils, rootScope, uri, authconf) {
// If some proposed configurations are still in the pipeline then retry // If some proposed configurations are still in the pipeline then retry
if (configurations.length) { if (configurations.length) {
alerts.log("The last connection attempt was unsuccessful. Trying another configuration"); alerts.log(filter('translate')("The last connection attempt was unsuccessful. Trying another configuration"));
timeout = setTimeout(update, 0); timeout = setTimeout(update, 0);
} }
else { else {
alerts.addAlert('<strong>Oh Snap!</strong> Could not connect to the aria2 RPC server. Will retry in 10 secs. You might want to check the connection settings by going to Settings > Connection Settings', 'error'); alerts.addAlert('<strong>' + filter('translate')('Oh Snap!') + '</strong> ' +
filter('translate')('Could not connect to the aria2 RPC server. Will retry in 10 secs. You might want to check the connection settings by going to Settings > Connection Settings')
, 'error')
timeout = setTimeout(update, globalTimeout); timeout = setTimeout(update, globalTimeout);
} }
}; };
@ -129,9 +131,9 @@ function(syscall, globalTimeout, alerts, utils, rootScope, uri, authconf) {
// configuration worked, save it in cookie for next time and // configuration worked, save it in cookie for next time and
// delete the pipelined configurations!! // delete the pipelined configurations!!
if (currentToken) if (currentToken)
alerts.addAlert('Successfully connected to Aria2 through its remote RPC …', 'success'); alerts.addAlert(filter('translate')('Successfully connected to Aria2 through its remote RPC …'), 'success');
else else
alerts.addAlert('Successfully connected to Aria2 through remote RPC, however the connection is still insecure. For complete security try adding an authorization secret token while starting Aria2 (through the flag --rpc-secret)'); alerts.addAlert(filter('translate')('Successfully connected to Aria2 through remote RPC, however the connection is still insecure. For complete security try adding an authorization secret token while starting Aria2 (through the flag --rpc-secret)'));
configurations = []; configurations = [];
} }
@ -180,7 +182,7 @@ function(syscall, globalTimeout, alerts, utils, rootScope, uri, authconf) {
// each one will be tried one after the other till success, // each one will be tried one after the other till success,
// for all options for one conf read rpc/syscall.js // for all options for one conf read rpc/syscall.js
configure: function(conf) { configure: function(conf) {
alerts.addAlert('Trying to connect to aria2 using the new connection configuration', 'info'); alerts.addAlert(filter('translate')('Trying to connect to aria2 using the new connection configuration'), 'info');
if (conf instanceof Array) if (conf instanceof Array)
configurations = conf; configurations = conf;

View File

@ -133,5 +133,12 @@ translations.en_US = {
'Download GID':'Download GID', 'Download GID':'Download GID',
'Number of Pieces':'Number of Pieces', 'Number of Pieces':'Number of Pieces',
'Piece Length': 'Piece Length', 'Piece Length': 'Piece Length',
'Shutdown Server': 'Shutdown Server' 'Shutdown Server': 'Shutdown Server',
'The last connection attempt was unsuccessful. Trying another configuration': 'The last connection attempt was unsuccessful. Trying another configuration',
'Oh Snap!': 'Oh Snap!',
'Could not connect to the aria2 RPC server. Will retry in 10 secs. You might want to check the connection settings by going to Settings > Connection Settings': 'Could not connect to the aria2 RPC server. Will retry in 10 secs. You might want to check the connection settings by going to Settings > Connection Settings',
'Successfully connected to Aria2 through its remote RPC …': 'Successfully connected to Aria2 through its remote RPC …',
'Successfully connected to Aria2 through remote RPC, however the connection is still insecure. For complete security try adding an authorization secret token while starting Aria2 (through the flag --rpc-secret)': 'Successfully connected to Aria2 through remote RPC, however the connection is still insecure. For complete security try adding an authorization secret token while starting Aria2 (through the flag --rpc-secret)',
'Trying to connect to aria2 using the new connection configuration': 'Trying to connect to aria2 using the new connection configuration',
}; };

View File

@ -147,5 +147,15 @@ translations.en_US = { // replace en_US to ll_CC, examples: zh_CN, de_AT.
'Uploaded':'', 'Uploaded':'',
'Download GID':'', 'Download GID':'',
'Number of Pieces':'', 'Number of Pieces':'',
'Piece Length':'' 'Piece Length':'',
//alerts
'The last connection attempt was unsuccessful. Trying another configuration': '',
'Oh Snap!': 'Oh Snap!',
'Could not connect to the aria2 RPC server. Will retry in 10 secs. You might want to check the connection settings by going to Settings > Connection Settings': '',
'Successfully connected to Aria2 through its remote RPC …': '',
'Successfully connected to Aria2 through remote RPC, however the connection is still insecure. For complete security try adding an authorization secret token while starting Aria2 (through the flag --rpc-secret)': '',
'Trying to connect to aria2 using the new connection configuration': '',
}; };

View File

@ -118,7 +118,7 @@ translations.zh_CN = {
// about modal // about modal
'To download the latest version of the project, add issues or to contribute back, head on to': 'To download the latest version of the project, add issues or to contribute back, head on to':
'下载最新版本,反馈问题,请到', '下载最新版本,反馈问题,请到',
'Or you can open the latest version in browser through': '在线使用请开打', 'Or you can open the latest version in the browser through': '在线使用请开打',
'Close': '关闭', 'Close': '关闭',
// lables // lables
'Download status':'下载状态', 'Download status':'下载状态',
@ -134,4 +134,3 @@ translations.zh_CN = {
'Number of Pieces':'块数量', 'Number of Pieces':'块数量',
'Piece Length':'每块大小' 'Piece Length':'每块大小'
}; };