show current aria2 rpc host and connection status
This commit is contained in:
parent
2b2dc1c4e3
commit
66b4974c95
|
@ -7,6 +7,9 @@ Confirm=确认
|
|||
Cancel=取消
|
||||
True=是
|
||||
False=否
|
||||
Connecting=连接中
|
||||
Connected=已连接
|
||||
Not Connected=未连接
|
||||
Global=全局
|
||||
RPC=RPC
|
||||
New=新建
|
||||
|
@ -116,6 +119,7 @@ Aria2 RPC Host=Aria2 RPC 主机
|
|||
Aria2 RPC Port=Aria2 RPC 端口
|
||||
Aria2 RPC Protocol=Aria2 RPC 协议
|
||||
Aria2 RPC Secret Token=Aria2 RPC 密钥
|
||||
Aria2 RPC Address=Aria2 RPC 地址
|
||||
Global Stat Refresh Interval=全局状态刷新间隔
|
||||
Download Task Refresh Interval=下载任务刷新间隔
|
||||
Supported Placeholder: AriaNg Title ${title}, Downloading Count ${downloading}, Waiting Count ${waiting}, Stopped Count ${stopped}, Download Speed ${downspeed}, Upload Speed ${upspeed}.=支持的占位符: AriaNg 标题 ${title}, 正在下载数量 ${downloading}, 正在等待数量 ${waiting}, 已停止数量 ${stopped}, 下载速度 ${downspeed}, 上传速度: ${upspeed}.
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
'Cancel': 'Cancel',
|
||||
'True': 'True',
|
||||
'False': 'False',
|
||||
'Connecting': 'Connecting',
|
||||
'Connected': 'Connected',
|
||||
'Not Connected': 'Not Connected',
|
||||
'Global': 'Global',
|
||||
'RPC': 'RPC',
|
||||
'New': 'New',
|
||||
|
@ -120,6 +123,7 @@
|
|||
'Aria2 RPC Port': 'Aria2 RPC Port',
|
||||
'Aria2 RPC Protocol': 'Aria2 RPC Protocol',
|
||||
'Aria2 RPC Secret Token': 'Aria2 RPC Secret Token',
|
||||
'Aria2 RPC Address': 'Aria2 RPC Address',
|
||||
'Global Stat Refresh Interval': 'Global Stat Refresh Interval',
|
||||
'Download Task Refresh Interval': 'Download Task Refresh Interval',
|
||||
'Supported Placeholder: AriaNg Title ${title}, Downloading Count ${downloading}, Waiting Count ${waiting}, Stopped Count ${stopped}, Download Speed ${downspeed}, Upload Speed ${upspeed}.': 'Supported Placeholder: AriaNg Title ${title}, Downloading Count ${downloading}, Waiting Count ${waiting}, Stopped Count ${stopped}, Download Speed ${downspeed}, Upload Speed ${upspeed}.',
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('ariaNg').controller('Aria2StatusController', ['$rootScope', '$scope', 'ariaNgCommonService', 'aria2SettingService', function ($rootScope, $scope, ariaNgCommonService, aria2SettingService) {
|
||||
angular.module('ariaNg').controller('Aria2StatusController', ['$rootScope', '$scope', 'ariaNgCommonService', 'ariaNgSettingService', 'aria2SettingService', function ($rootScope, $scope, ariaNgCommonService, ariaNgSettingService, aria2SettingService) {
|
||||
$scope.context = {
|
||||
aria2Status: null
|
||||
host: ariaNgSettingService.getJsonRpcUrl(),
|
||||
status: 'Connecting',
|
||||
serverStatus: null
|
||||
};
|
||||
|
||||
$scope.saveSession = function () {
|
||||
|
@ -27,7 +29,10 @@
|
|||
$rootScope.loadPromise = (function () {
|
||||
return aria2SettingService.getAria2Status(function (response) {
|
||||
if (response.success) {
|
||||
$scope.context.aria2Status = response.data;
|
||||
$scope.context.status = 'Connected';
|
||||
$scope.context.serverStatus = response.data;
|
||||
} else {
|
||||
$scope.context.status = 'Not Connected';
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
data: context.requestBody
|
||||
};
|
||||
|
||||
return $http(requestContext).success(function (data, header, config, status) {
|
||||
return $http(requestContext).success(function (data) {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
@ -24,9 +24,16 @@
|
|||
if (context.successCallback) {
|
||||
context.successCallback(data.id, data.result);
|
||||
}
|
||||
}).error(function (data, header, config, status) {
|
||||
}).error(function (data) {
|
||||
if (!data) {
|
||||
return;
|
||||
data = {
|
||||
id: '-1',
|
||||
error: {
|
||||
// code: '-1',
|
||||
// message: 'Unknown Error',
|
||||
innerError: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (context.errorCallback) {
|
||||
|
|
|
@ -2,21 +2,38 @@
|
|||
<div class="settings-table striped hoverable">
|
||||
<div class="row">
|
||||
<div class="setting-key col-sm-4">
|
||||
<span translate>Aria2 Version</span>
|
||||
<span translate>Aria2 RPC Address</span>
|
||||
</div>
|
||||
<div class="setting-value col-sm-8">
|
||||
<span ng-bind="context.aria2Status.version"></span>
|
||||
<span ng-bind="context.host"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="setting-key col-sm-4">
|
||||
<span translate>Aria2 Status</span>
|
||||
</div>
|
||||
<div class="setting-value col-sm-8">
|
||||
<span class="label" ng-class="{'label-primary': context.status === 'Connecting', 'label-success': context.status === 'Connected', 'label-danger': context.status === 'Not Connected'}"
|
||||
ng-bind="context.status | translate"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ng-cloak" ng-if="context.serverStatus">
|
||||
<div class="setting-key col-sm-4">
|
||||
<span translate>Aria2 Version</span>
|
||||
</div>
|
||||
<div class="setting-value col-sm-8">
|
||||
<span ng-bind="context.serverStatus.version"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ng-cloak" ng-if="context.serverStatus">
|
||||
<div class="setting-key col-sm-4">
|
||||
<span translate>Enabled Features</span>
|
||||
</div>
|
||||
<div class="setting-value col-sm-8">
|
||||
<span class="wholeline" ng-repeat="feature in context.aria2Status.enabledFeatures" ng-bind="feature"></span>
|
||||
<span class="wholeline" ng-repeat="feature in context.serverStatus.enabledFeatures" ng-bind="feature"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ng-cloak" ng-if="context.aria2Status">
|
||||
<div class="row ng-cloak" ng-if="context.serverStatus">
|
||||
<div class="setting-key setting-key-without-desc col-sm-4">
|
||||
<span translate>Functions</span>
|
||||
</div>
|
||||
|
|
Reference in a new issue