mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
gui: Select / Deselect all folders / devices (#fixes 4000) (#5307)
This commit is contained in:
parent
e67be59c5f
commit
f51514d0e7
@ -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;
|
||||
|
@ -67,7 +67,11 @@
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label translate for="folders">Share Folders With Device</label>
|
||||
<p translate class="help-block">Select the folders to share with this device.</p>
|
||||
<p class="help-block">
|
||||
<span translate>Select the folders to share with this device.</span> 
|
||||
<small><a href="#" ng-click="selectAllFolders()" translate>Select All</a> 
|
||||
<a href="#" ng-click="deSelectAllFolders()" translate>Deselect All</a></small>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-4" ng-repeat="folder in folderList()">
|
||||
<div class="checkbox">
|
||||
|
@ -42,7 +42,11 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label translate for="devices">Share With Devices</label>
|
||||
<p translate class="help-block">Select the devices to share this folder with.</p>
|
||||
<p class="help-block">
|
||||
<span translate>Select the devices to share this folder with.</span> 
|
||||
<small><a href="#" ng-click="selectAllDevices()" translate>Select All</a> 
|
||||
<a href="#" ng-click="deSelectAllDevices()" translate>Deselect All</a></small>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-4" ng-repeat="device in otherDevices()">
|
||||
<div class="checkbox">
|
||||
|
Loading…
Reference in New Issue
Block a user