diff --git a/src/scripts/controllers/command.js b/src/scripts/controllers/command.js index 2b5616ab..420a2a92 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 89a68b4a..aa61b6af 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'