move setting item order

This commit is contained in:
MaysWind 2018-08-14 22:06:22 +08:00
parent a30f530996
commit 3004b7be8c
3 changed files with 53 additions and 53 deletions

View file

@ -99,6 +99,11 @@
}
};
$scope.isSupportNotification = function () {
return ariaNgNotificationService.isSupportBrowserNotification() &&
ariaNgSettingService.isCurrentRpcUseWebSocket($scope.context.settings.protocol);
};
$scope.setLanguage = function (value) {
if (ariaNgSettingService.setLanguage(value)) {
ariaNgLocalizationService.applyLanguage(value);
@ -107,19 +112,6 @@
$scope.updateTitlePreview();
};
$scope.setRPCListDisplayOrder = function (value) {
setNeedRefreshPage();
ariaNgSettingService.setRPCListDisplayOrder(value);
};
$scope.setAfterCreatingNewTask = function (value) {
ariaNgSettingService.setAfterCreatingNewTask(value);
};
$scope.setRemoveOldTaskAfterRestarting = function (value) {
ariaNgSettingService.setRemoveOldTaskAfterRestarting(value);
};
$scope.setDebugMode = function (value) {
ariaNgSettingService.setDebugMode(value);
};
@ -128,16 +120,6 @@
ariaNgSettingService.setTitle(value);
};
$scope.setTitleRefreshInterval = function (value) {
setNeedRefreshPage();
ariaNgSettingService.setTitleRefreshInterval(value);
};
$scope.isSupportNotification = function () {
return ariaNgNotificationService.isSupportBrowserNotification() &&
ariaNgSettingService.isCurrentRpcUseWebSocket($scope.context.settings.protocol);
};
$scope.setEnableBrowserNotification = function (value) {
ariaNgSettingService.setBrowserNotification(value);
@ -151,6 +133,11 @@
}
};
$scope.setTitleRefreshInterval = function (value) {
setNeedRefreshPage();
ariaNgSettingService.setTitleRefreshInterval(value);
};
$scope.setGlobalStatRefreshInterval = function (value) {
setNeedRefreshPage();
ariaNgSettingService.setGlobalStatRefreshInterval(value);
@ -161,6 +148,19 @@
ariaNgSettingService.setDownloadTaskRefreshInterval(value);
};
$scope.setRPCListDisplayOrder = function (value) {
setNeedRefreshPage();
ariaNgSettingService.setRPCListDisplayOrder(value);
};
$scope.setAfterCreatingNewTask = function (value) {
ariaNgSettingService.setAfterCreatingNewTask(value);
};
$scope.setRemoveOldTaskAfterRestarting = function (value) {
ariaNgSettingService.setRemoveOldTaskAfterRestarting(value);
};
$scope.addNewRpcSetting = function () {
setNeedRefreshPage();

View file

@ -287,12 +287,30 @@
setTitle: function (value) {
setOption('title', value);
},
getBrowserNotification: function () {
return getOption('browserNotification');
},
setBrowserNotification: function (value) {
setOption('browserNotification', value);
},
getTitleRefreshInterval: function () {
return getOption('titleRefreshInterval');
},
setTitleRefreshInterval: function (value) {
setOption('titleRefreshInterval', Math.max(parseInt(value), 0));
},
getGlobalStatRefreshInterval: function () {
return getOption('globalStatRefreshInterval');
},
setGlobalStatRefreshInterval: function (value) {
setOption('globalStatRefreshInterval', Math.max(parseInt(value), 0));
},
getDownloadTaskRefreshInterval: function () {
return getOption('downloadTaskRefreshInterval');
},
setDownloadTaskRefreshInterval: function (value) {
setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0));
},
getRPCListDisplayOrder: function () {
return getOption('rpcListDisplayOrder');
},
@ -311,12 +329,6 @@
setRemoveOldTaskAfterRestarting: function (value) {
setOption('removeOldTaskAfterRestarting', value);
},
getBrowserNotification: function () {
return getOption('browserNotification');
},
setBrowserNotification: function (value) {
setOption('browserNotification', value);
},
getCurrentRpcDisplayName: function () {
var options = getOptions();
@ -503,18 +515,6 @@
return true;
},
getGlobalStatRefreshInterval: function () {
return getOption('globalStatRefreshInterval');
},
setGlobalStatRefreshInterval: function (value) {
setOption('globalStatRefreshInterval', Math.max(parseInt(value), 0));
},
getDownloadTaskRefreshInterval: function () {
return getOption('downloadTaskRefreshInterval');
},
setDownloadTaskRefreshInterval: function (value) {
setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0));
},
getDisplayOrder: function () {
var value = getOption('displayOrder');

View file

@ -64,6 +64,18 @@
<em>[<span translate>Preview</span>] <span ng-bind="context.titlePreview"></span></em>
</div>
</div>
<div class="row" ng-if="isSupportNotification()">
<div class="setting-key setting-key-without-desc col-sm-4">
<span translate>Enable Browser Notification</span>
</div>
<div class="setting-value col-sm-8">
<select class="form-control" style="width: 100%;"
ng-model="context.settings.browserNotification"
ng-change="setEnableBrowserNotification(context.settings.browserNotification)"
ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions">
</select>
</div>
</div>
<div class="row">
<div class="setting-key setting-key-without-desc col-sm-4">
<span translate>Page Title Refresh Interval</span>
@ -77,18 +89,6 @@
</select>
</div>
</div>
<div class="row" ng-if="isSupportNotification()">
<div class="setting-key setting-key-without-desc col-sm-4">
<span translate>Enable Browser Notification</span>
</div>
<div class="setting-value col-sm-8">
<select class="form-control" style="width: 100%;"
ng-model="context.settings.browserNotification"
ng-change="setEnableBrowserNotification(context.settings.browserNotification)"
ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions">
</select>
</div>
</div>
<div class="row">
<div class="setting-key setting-key-without-desc col-sm-4">
<span translate>Global Stat Refresh Interval</span>