support reset settings

This commit is contained in:
MaysWind 2017-06-18 14:00:14 +08:00
parent c2a84bca5e
commit dd1b922694
5 changed files with 23 additions and 0 deletions

View file

@ -136,6 +136,9 @@ Aria2 RPC Http Request Method=Aria2 RPC Http 请求方法
POST method only supports aria2 v1.15.2 and above.=POST 方法仅支持 aria2 v1.15.2 及以上. POST method only supports aria2 v1.15.2 and above.=POST 方法仅支持 aria2 v1.15.2 及以上.
Aria2 RPC Secret Token=Aria2 RPC 密钥 Aria2 RPC Secret Token=Aria2 RPC 密钥
Activate=激活 Activate=激活
Reset Settings=重置设置
Confirm Reset=确认重置
Are you sure you want to reset all settings?=您是否要重置所有设置?
Delete RPC Setting=删除 RPC 设置 Delete RPC Setting=删除 RPC 设置
Add New RPC Setting=添加新 RPC 配置 Add New RPC Setting=添加新 RPC 配置
Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要删除 RPC 设置 "{{rpcName}}"? Are you sure you want to remove rpc setting "{{rpcName}}"?=您是否要删除 RPC 设置 "{{rpcName}}"?

View file

@ -140,6 +140,9 @@
'POST method only supports aria2 v1.15.2 and above.': 'POST method only supports aria2 v1.15.2 and above.', 'POST method only supports aria2 v1.15.2 and above.': 'POST method only supports aria2 v1.15.2 and above.',
'Aria2 RPC Secret Token': 'Aria2 RPC Secret Token', 'Aria2 RPC Secret Token': 'Aria2 RPC Secret Token',
'Activate': 'Activate', 'Activate': 'Activate',
'Reset Settings': 'Reset Settings',
'Confirm Reset': 'Confirm Reset',
'Are you sure you want to reset all settings?': 'Are you sure you want to reset all settings?',
'Delete RPC Setting': 'Delete RPC Setting', 'Delete RPC Setting': 'Delete RPC Setting',
'Add New RPC Setting': 'Add New RPC Setting', 'Add New RPC Setting': 'Add New RPC Setting',
'Are you sure you want to remove rpc setting "{{rpcName}}"?': 'Are you sure you want to remove rpc setting "{{rpcName}}"?', 'Are you sure you want to remove rpc setting "{{rpcName}}"?': 'Are you sure you want to remove rpc setting "{{rpcName}}"?',

View file

@ -191,6 +191,13 @@
$window.location.reload(); $window.location.reload();
}; };
$scope.resetSettings = function () {
ariaNgCommonService.confirm('Confirm Reset', 'Are you sure you want to reset all settings?', 'warning', function () {
ariaNgSettingService.resetSettings();
$window.location.reload();
});
};
angular.element('[data-toggle="popover"]').popover(); angular.element('[data-toggle="popover"]').popover();
$rootScope.loadPromise = $timeout(function () {}, 100); $rootScope.loadPromise = $timeout(function () {}, 100);

View file

@ -62,6 +62,10 @@
return options; return options;
}; };
var clearAll = function () {
return localStorageService.clearAll();
};
var getOption = function (key) { var getOption = function (key) {
var options = getOptions(); var options = getOptions();
@ -428,6 +432,9 @@
setPeerListDisplayOrder: function (value) { setPeerListDisplayOrder: function (value) {
setOption('peerListDisplayOrder', value); setOption('peerListDisplayOrder', value);
}, },
resetSettings: function () {
clearAll();
},
onFirstAccess: function (callback) { onFirstAccess: function (callback) {
if (!callback) { if (!callback) {
return; return;

View file

@ -130,6 +130,9 @@
<div class="row tip no-background no-hover"> <div class="row tip no-background no-hover">
<span class="asterisk">*</span> <span class="asterisk">*</span>
<span translate>Changes to the settings take effect after refreshing page.</span> <span translate>Changes to the settings take effect after refreshing page.</span>
<button class="btn btn-xs btn-default" ng-click="resetSettings()">
<span translate>Reset Settings</span>
</button>
</div> </div>
</div> </div>
</div> </div>