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