From 5224f07ac875a89b94247e6d4f1031d71a98bc27 Mon Sep 17 00:00:00 2001
From: MikolajTwarog <43782609+MikolajTwarog@users.noreply.github.com>
Date: Mon, 27 Apr 2020 00:18:05 +0200
Subject: [PATCH] gui: Add "Pause All"/"Resume All" button for devices (fixes
#6530) (#6549)
---
gui/default/index.html | 6 ++++++
.../syncthing/core/syncthingController.js | 18 ++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/gui/default/index.html b/gui/default/index.html
index 624ffe901..7d05d39c9 100644
--- a/gui/default/index.html
+++ b/gui/default/index.html
@@ -788,6 +788,12 @@
+
+
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index 277b37e8e..cd3f6e105 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -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 [];