mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00: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();
|
$('#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) {
|
$scope.addDevice = function (deviceID, name) {
|
||||||
return $http.get(urlbase + '/system/discovery')
|
return $http.get(urlbase + '/system/discovery')
|
||||||
.success(function (registry) {
|
.success(function (registry) {
|
||||||
@ -1694,6 +1708,20 @@ angular.module('syncthing.core')
|
|||||||
$scope.editFolderModal();
|
$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 () {
|
$scope.addFolder = function () {
|
||||||
$http.get(urlbase + '/svc/random/string?length=10').success(function (data) {
|
$http.get(urlbase + '/svc/random/string?length=10').success(function (data) {
|
||||||
$scope.editingExisting = false;
|
$scope.editingExisting = false;
|
||||||
|
@ -67,7 +67,11 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label translate for="folders">Share Folders With Device</label>
|
<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="row">
|
||||||
<div class="col-md-4" ng-repeat="folder in folderList()">
|
<div class="col-md-4" ng-repeat="folder in folderList()">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
@ -42,7 +42,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label translate for="devices">Share With Devices</label>
|
<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="row">
|
||||||
<div class="col-md-4" ng-repeat="device in otherDevices()">
|
<div class="col-md-4" ng-repeat="device in otherDevices()">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
Loading…
Reference in New Issue
Block a user