diff --git a/src/scripts/controllers/command.js b/src/scripts/controllers/command.js index 2b5616a..420a2a9 100644 --- a/src/scripts/controllers/command.js +++ b/src/scripts/controllers/command.js @@ -80,9 +80,9 @@ }; var doCommand = function (path, params) { - if (path.indexOf('/new/') === 0) { + if (path.indexOf('/new') === 0) { return doNewTaskCommand(params.url); - } else if (path.indexOf('/settings/rpc/set/') === 0) { + } else if (path.indexOf('/settings/rpc/set') === 0) { return doSetRpcCommand(params.protocol, params.host, params.port, params.interface, params.secret); } else { ariaNgCommonService.showError('Parameter is invalid!'); @@ -90,7 +90,9 @@ } }; - if (!doCommand(path, $routeParams)) { + var allParameters = angular.extend({}, $routeParams, $location.search()); + + if (!doCommand(path, allParameters)) { $location.path('/downloading'); } }]); diff --git a/src/scripts/core/router.js b/src/scripts/core/router.js index 89a68b4..aa61b6a 100644 --- a/src/scripts/core/router.js +++ b/src/scripts/core/router.js @@ -67,6 +67,10 @@ templateUrl: 'views/settings-aria2.html', controller: 'Aria2SettingsController' }) + .when('/settings/rpc/set', { + template: '', + controller: 'CommandController' + }) .when('/settings/rpc/set/:protocol/:host/:port/:interface/:secret?', { template: '', controller: 'CommandController'