support display aria2 status

This commit is contained in:
MaysWind 2016-05-22 11:47:47 +08:00
parent eac99875d6
commit 84d4743ef0
7 changed files with 59 additions and 0 deletions

View file

@ -141,6 +141,9 @@
</li>
</ul>
</li>
<li data-href-match="/status">
<a href="#/status"><i class="fa fa-server"></i> <span translate>Aria2 Status</span></a>
</li>
</ul>
</section>
</aside>
@ -217,6 +220,7 @@
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/settings-aria2.js"></script>
<script src="scripts/controllers/settings-ariang.js"></script>
<script src="scripts/controllers/status.js"></script>
<script src="scripts/filters/dateDuration.js"></script>
<script src="scripts/filters/percent.js"></script>
<script src="scripts/filters/substring.js"></script>

View file

@ -0,0 +1,13 @@
(function () {
'use strict';
angular.module('ariaNg').controller('Aria2StatusController', ['$scope', 'SweetAlert', 'aria2RpcService', 'ariaNgSettingService', function ($scope, SweetAlert, aria2RpcService, ariaNgSettingService) {
$scope.loadPromise = (function () {
return aria2RpcService.getVersion({
callback: function (result) {
$scope.serverStatus = result;
}
})
})();
}]);
})();

View file

@ -35,6 +35,10 @@
templateUrl: 'views/settings-aria2.html',
controller: 'Aria2SettingsController'
})
.when('/status', {
templateUrl: 'views/status.html',
controller: 'Aria2StatusController'
})
.otherwise({
redirectTo: '/downloading'
});

View file

@ -26,6 +26,7 @@
'BitTorrent Settings': 'BitTorrent Settings',
'RPC Settings': 'RPC Settings',
'Advanced Settings': 'Advanced Settings',
'Aria2 Status': 'Aria2 Status',
'File Name': 'File Name',
'File Size': 'File Size',
'Completed Percent': 'Percent',
@ -38,6 +39,8 @@
'Aria2 RPC Protocol': 'Aria2 RPC Protocol',
'Global Stat Refresh Interval': 'Global Stat Refresh Interval',
'Download Task Refresh Interval': 'Download Task Refresh Interval',
'Aria2 Version': 'Aria2 Version',
'Enabled Features': 'Enabled Features',
'Toggle Navigation': 'Toggle Navigation',
'Loading': 'Loading...',
'More Than One Day': 'More than 1 day',

View file

@ -26,6 +26,7 @@
'BitTorrent Settings': 'BitTorrent 设置',
'RPC Settings': 'RPC 设置',
'Advanced Settings': '高级设置',
'Aria2 Status': 'Aria2 状态',
'File Name': '文件名',
'File Size': '大小',
'Completed Percent': '进度',
@ -38,6 +39,8 @@
'Aria2 RPC Protocol': 'Aria2 RPC 协议',
'Global Stat Refresh Interval': '全局状态刷新间隔',
'Download Task Refresh Interval': '下载任务刷新间隔',
'Aria2 Version': 'Aria2 版本',
'Enabled Features': '已启用的功能',
'Toggle Navigation': '切换导航',
'Loading': '正在加载...',
'More Than One Day': '超过1天',

View file

@ -357,6 +357,10 @@ td {
display: block;
}
.settings-table .wholeline {
display: block;
}
.settings-table .tip {
background-color: #fff !important;
font-size: 12px;
@ -367,6 +371,14 @@ td {
}
@media (max-width: 767px) {
.settings-table .setting-key {
font-weight: bold;
}
.settings-table .status-key {
font-weight: bold;
}
.settings-table .description {
display: inline-block;
}

20
app/views/status.html Normal file
View file

@ -0,0 +1,20 @@
<section class="content no-padding">
<div class="settings-table">
<div class="row">
<div class="status-key col-sm-4">
<span translate>Aria2 Version</span>
</div>
<div class="status-value col-sm-8">
<span ng-bind="serverStatus.version"></span>
</div>
</div>
<div class="row">
<div class="status-key col-sm-4">
<span translate>Enabled Features</span>
</div>
<div class="status-value col-sm-8">
<span class="wholeline" ng-repeat="feature in serverStatus.enabledFeatures" ng-bind="feature"></span>
</div>
</div>
</div>
</section>