add option for changing task order by drag-and-drop

This commit is contained in:
MaysWind 2021-02-11 01:18:48 +08:00
parent 5f718894aa
commit 220df6ca49
8 changed files with 29 additions and 0 deletions

View file

@ -175,6 +175,7 @@ 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}}"?
Updating Global Stat Interval=全局状态更新间隔 Updating Global Stat Interval=全局状态更新间隔
Updating Task Information Interval=任务信息更新间隔 Updating Task Information Interval=任务信息更新间隔
Change Tasks Order by Drag-and-drop=拖拽任务排序
Action After Creating New Tasks=创建新任务后执行操作 Action After Creating New Tasks=创建新任务后执行操作
Navigate to Task List Page=转到任务列表页面 Navigate to Task List Page=转到任务列表页面
Navigate to Task Detail Page=转到任务详情页面 Navigate to Task Detail Page=转到任务详情页面

View file

@ -175,6 +175,7 @@ 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}}"?
Updating Global Stat Interval=全域狀態更新間隔 Updating Global Stat Interval=全域狀態更新間隔
Updating Task Information Interval=工作資訊更新間隔 Updating Task Information Interval=工作資訊更新間隔
Change Tasks Order by Drag-and-drop=拖拽工作排序
Action After Creating New Tasks=建立新工作後執行操作 Action After Creating New Tasks=建立新工作後執行操作
Navigate to Task List Page=轉到工作清單頁面 Navigate to Task List Page=轉到工作清單頁面
Navigate to Task Detail Page=轉到工作詳情頁面 Navigate to Task Detail Page=轉到工作詳情頁面

View file

@ -37,6 +37,7 @@
extendRpcServers: [], extendRpcServers: [],
globalStatRefreshInterval: 1000, globalStatRefreshInterval: 1000,
downloadTaskRefreshInterval: 1000, downloadTaskRefreshInterval: 1000,
dragAndDropTasks: true,
rpcListDisplayOrder: 'recentlyUsed', rpcListDisplayOrder: 'recentlyUsed',
afterCreatingNewTask: 'task-list', afterCreatingNewTask: 'task-list',
removeOldTaskAfterRetrying: false, removeOldTaskAfterRetrying: false,

View file

@ -179,6 +179,7 @@
'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}}"?',
'Updating Global Stat Interval': 'Updating Global Stat Interval', 'Updating Global Stat Interval': 'Updating Global Stat Interval',
'Updating Task Information Interval': 'Updating Task Information Interval', 'Updating Task Information Interval': 'Updating Task Information Interval',
'Change Tasks Order by Drag-and-drop': 'Change Tasks Order by Drag-and-drop',
'Action After Creating New Tasks': 'Action After Creating New Tasks', 'Action After Creating New Tasks': 'Action After Creating New Tasks',
'Navigate to Task List Page': 'Navigate to Task List Page', 'Navigate to Task List Page': 'Navigate to Task List Page',
'Navigate to Task Detail Page': 'Navigate to Task Detail Page', 'Navigate to Task Detail Page': 'Navigate to Task Detail Page',

View file

@ -79,6 +79,10 @@
}; };
$scope.isSupportDragTask = function () { $scope.isSupportDragTask = function () {
if (!ariaNgSettingService.getDragAndDropTasks()) {
return false;
}
var displayOrder = ariaNgCommonService.parseOrderType(ariaNgSettingService.getDisplayOrder()); var displayOrder = ariaNgCommonService.parseOrderType(ariaNgSettingService.getDisplayOrder());
return location === 'waiting' && displayOrder.type === 'default'; return location === 'waiting' && displayOrder.type === 'default';

View file

@ -185,6 +185,10 @@
ariaNgSettingService.setRPCListDisplayOrder(value); ariaNgSettingService.setRPCListDisplayOrder(value);
}; };
$scope.setDragAndDropTasks = function (value) {
ariaNgSettingService.setDragAndDropTasks(value);
};
$scope.setAfterCreatingNewTask = function (value) { $scope.setAfterCreatingNewTask = function (value) {
ariaNgSettingService.setAfterCreatingNewTask(value); ariaNgSettingService.setAfterCreatingNewTask(value);
}; };

View file

@ -391,6 +391,12 @@
setDownloadTaskRefreshInterval: function (value) { setDownloadTaskRefreshInterval: function (value) {
setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0)); setOption('downloadTaskRefreshInterval', Math.max(parseInt(value), 0));
}, },
getDragAndDropTasks: function () {
return getOption('dragAndDropTasks');
},
setDragAndDropTasks: function (value) {
setOption('dragAndDropTasks', value);
},
getRPCListDisplayOrder: function () { getRPCListDisplayOrder: function () {
return getOption('rpcListDisplayOrder'); return getOption('rpcListDisplayOrder');
}, },

View file

@ -135,6 +135,17 @@
</select> </select>
</div> </div>
</div> </div>
<div class="row">
<div class="setting-key setting-key-without-desc col-sm-4">
<span translate>Change Tasks Order by Drag-and-drop</span>
</div>
<div class="setting-value col-sm-8">
<select class="form-control" style="width: 100%;" ng-model="context.settings.dragAndDropTasks"
ng-change="setDragAndDropTasks(context.settings.dragAndDropTasks)"
ng-options="option.value as (option.name | translate) for option in context.trueFalseOptions">
</select>
</div>
</div>
<div class="row"> <div class="row">
<div class="setting-key setting-key-without-desc col-sm-4"> <div class="setting-key setting-key-without-desc col-sm-4">
<span translate>RPC List Display Order</span> <span translate>RPC List Display Order</span>