mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
GUI: Added "Pause All Folders" and "Resume All Folders buttons
As per scienmind's post (#3964) i though it was a good idea and wanted such a button. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3973 LGTM: AudriusButkevicius, calmh
This commit is contained in:
parent
22903df2c1
commit
0c68e1e510
@ -437,6 +437,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<span class="pull-right">
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="setAllFoldersPause(true)" ng-if="isAtleastOneFolderPausedStateSetTo(false)">
|
||||
<span class="fa fa-refresh"></span> <span translate>Pause All Folders</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="setAllFoldersPause(false)" ng-if="isAtleastOneFolderPausedStateSetTo(true)">
|
||||
<span class="fa fa-refresh"></span> <span translate>Resume All Folders</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="rescanAllFolders()">
|
||||
<span class="fa fa-refresh"></span> <span translate>Rescan All</span>
|
||||
</button>
|
||||
|
@ -1661,6 +1661,29 @@ angular.module('syncthing.core')
|
||||
$http.post(urlbase + "/db/scan?folder=" + encodeURIComponent(folder));
|
||||
};
|
||||
|
||||
$scope.setAllFoldersPause = function(pause) {
|
||||
var folderListCache = $scope.folderList();
|
||||
|
||||
for (var i = 0; i < folderListCache.length; i++) {
|
||||
folderListCache[i].paused = pause;
|
||||
}
|
||||
|
||||
$scope.config.folders = folderList(folderListCache);
|
||||
$scope.saveConfig();
|
||||
};
|
||||
|
||||
$scope.isAtleastOneFolderPausedStateSetTo = function(pause) {
|
||||
var folderListCache = $scope.folderList();
|
||||
|
||||
for (var i = 0; i < folderListCache.length; i++) {
|
||||
if (folderListCache[i].paused == pause) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.bumpFile = function (folder, file) {
|
||||
var url = urlbase + "/db/prio?folder=" + encodeURIComponent(folder) + "&file=" + encodeURIComponent(file);
|
||||
// In order to get the right view of data in the response.
|
||||
|
Loading…
Reference in New Issue
Block a user