diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 445dd3b6..1d4037d8 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -1371,6 +1371,20 @@ angular.module('syncthing.core') $('#editDevice').modal(); }; + $scope.selectAllFolders = function() { + Object.entries($scope.folders).forEach(entry =>{ + let id = entry[1].id; + $scope.currentDevice.selectedFolders[id] = true; + }); + }; + + $scope.deSelectAllFolders = function() { + Object.entries($scope.folders).forEach(entry =>{ + let id = entry[1].id; + $scope.currentDevice.selectedFolders[id] = false; + }); + }; + $scope.addDevice = function (deviceID, name) { return $http.get(urlbase + '/system/discovery') .success(function (registry) { @@ -1694,6 +1708,20 @@ angular.module('syncthing.core') $scope.editFolderModal(); }; + $scope.selectAllDevices = function() { + var devices = $scope.otherDevices(); + for (var i = 0; i < devices.length; i++){ + $scope.currentFolder.selectedDevices[devices[i].deviceID] = true; + } + }; + + $scope.deSelectAllDevices = function() { + var devices = $scope.otherDevices(); + for (var i = 0; i < devices.length; i++){ + $scope.currentFolder.selectedDevices[devices[i].deviceID] = false; + } + }; + $scope.addFolder = function () { $http.get(urlbase + '/svc/random/string?length=10').success(function (data) { $scope.editingExisting = false; diff --git a/gui/default/syncthing/device/editDeviceModalView.html b/gui/default/syncthing/device/editDeviceModalView.html index 6a0bb69a..c51d3c8e 100644 --- a/gui/default/syncthing/device/editDeviceModalView.html +++ b/gui/default/syncthing/device/editDeviceModalView.html @@ -67,7 +67,11 @@
Select the folders to share with this device.
++ Select the folders to share with this device. + Select All + Deselect All +
Select the devices to share this folder with.
++ Select the devices to share this folder with. + Select All + Deselect All +