optimize dependency
This commit is contained in:
parent
8eb5f84778
commit
abe74c4ac1
|
@ -1,7 +1,7 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('ariaNg').factory('aria2RpcService', ['$q', 'aria2RpcConstants', 'aria2RpcErrors', 'ariaNgCommonService', 'ariaNgSettingService', 'aria2HttpRpcService', 'aria2WebSocketRpcService', function ($q, aria2RpcConstants, aria2RpcErrors, ariaNgCommonService, ariaNgSettingService, aria2HttpRpcService, aria2WebSocketRpcService) {
|
||||
angular.module('ariaNg').factory('aria2RpcService', ['$q', 'aria2RpcConstants', 'aria2RpcErrors', 'ariaNgCommonService', 'ariaNgSettingService', 'ariaNgLogService', 'aria2HttpRpcService', 'aria2WebSocketRpcService', function ($q, aria2RpcConstants, aria2RpcErrors, ariaNgCommonService, ariaNgSettingService, ariaNgLogService, aria2HttpRpcService, aria2WebSocketRpcService) {
|
||||
var rpcImplementService = ariaNgSettingService.isUseWebSocket() ? aria2WebSocketRpcService : aria2HttpRpcService;
|
||||
var isConnected = false;
|
||||
var secret = ariaNgSettingService.getSecret();
|
||||
|
@ -112,6 +112,8 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
ariaNgLogService.error('[aria2RpcService.processError] ' + error.message, error);
|
||||
|
||||
if (aria2RpcErrors[error.message] && aria2RpcErrors[error.message].tipTextKey) {
|
||||
ariaNgCommonService.showError(aria2RpcErrors[error.message].tipTextKey);
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('ariaNg').factory('ariaNgCommonService', ['$location', '$timeout', 'base64', 'SweetAlert', '$translate', 'ariaNgConstants', 'ariaNgLogService', function ($location, $timeout, base64, SweetAlert, $translate, ariaNgConstants, ariaNgLogService) {
|
||||
angular.module('ariaNg').factory('ariaNgCommonService', ['$location', '$timeout', 'base64', 'SweetAlert', '$translate', 'ariaNgConstants', function ($location, $timeout, base64, SweetAlert, $translate, ariaNgConstants) {
|
||||
return {
|
||||
generateUniqueId: function () {
|
||||
var sourceId = ariaNgConstants.appPrefix + '_' + Math.round(new Date().getTime() / 1000) + '_' + Math.random();
|
||||
|
@ -20,7 +20,6 @@
|
|||
}, 100);
|
||||
},
|
||||
showError: function (text) {
|
||||
ariaNgLogService.info('[ariaNgCommonService.showError] ' + text);
|
||||
this.showDialog('Error', text, 'error');
|
||||
},
|
||||
showOperationSucceeded: function (text) {
|
||||
|
|
Reference in a new issue