From 0c68e1e510e2e92beed870b3ea30fb047d6dabcf Mon Sep 17 00:00:00 2001 From: Niller303 Date: Thu, 9 Feb 2017 20:31:23 +0000 Subject: [PATCH] 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 --- gui/default/index.html | 6 +++++ .../syncthing/core/syncthingController.js | 23 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/gui/default/index.html b/gui/default/index.html index ba628417a..16a726bfb 100644 --- a/gui/default/index.html +++ b/gui/default/index.html @@ -437,6 +437,12 @@ + + diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 3626cb9c7..4f7de0ff6 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -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.