gui: Add "Pause All"/"Resume All" button for devices (fixes #6530) (#6549)

This commit is contained in:
MikolajTwarog
2020-04-27 00:18:05 +02:00
committed by GitHub
parent d9664a946d
commit 5224f07ac8
2 changed files with 24 additions and 0 deletions
@@ -1588,6 +1588,24 @@ angular.module('syncthing.core')
return devices;
};
$scope.setAllDevicesPause = function (pause) {
$scope.devices.forEach(function (cfg) {
cfg.paused = pause;
});
$scope.config.devices = $scope.devices;
$scope.saveConfig();
}
$scope.isAtleastOneDevicePausedStateSetTo = function (pause) {
for (var i = 0; i < $scope.devices.length; i++) {
if ($scope.devices[i].paused == pause) {
return true;
}
}
return false
}
$scope.errorList = function () {
if (!$scope.errors) {
return [];