all: Automatic/disabled folder-config when receive-encrypted (#7327)

This commit is contained in:
Simon Frei
2021-02-12 22:51:29 +01:00
committed by GitHub
parent 7e4e2f3720
commit 80fc238bec
13 changed files with 221 additions and 130 deletions
@@ -51,6 +51,7 @@ angular.module('syncthing.core')
$scope.globalChangeEvents = {};
$scope.metricRates = false;
$scope.folderPathErrors = {};
$scope.currentSharing = {};
$scope.currentFolder = {};
$scope.currentDevice = {};
$scope.ignores = {
@@ -276,7 +277,8 @@ angular.module('syncthing.core')
arg.data.added.forEach(function (rejected) {
var offeringDevice = {
time: arg.time,
label: rejected.folderLabel
label: rejected.folderLabel,
receiveEncrypted: rejected.receiveEncrypted,
};
console.log("rejected folder", rejected.folderID, "from device:", rejected.deviceID, offeringDevice);
@@ -1814,12 +1816,18 @@ angular.module('syncthing.core')
$scope.currentFolder.path = pathJoin($scope.config.defaults.folder.path, newvalue);
});
$scope.fsWatcherToggled = function () {
if ($scope.currentFolder.fsWatcherEnabled) {
$scope.currentFolder.rescanIntervalS = 3600;
} else {
$scope.currentFolder.rescanIntervalS = 60;
$scope.setFSWatcherIntervalDefault = function () {
var defaultRescanIntervals = [60, 3600];
if (defaultRescanIntervals.indexOf($scope.currentFolder.rescanIntervalS) === -1) {
return;
}
var idx;
if ($scope.currentFolder.fsWatcherEnabled) {
idx = 1;
} else {
idx = 0;
}
$scope.currentFolder.rescanIntervalS = defaultRescanIntervals[idx];
};
$scope.loadFormIntoScope = function (form) {
@@ -1979,13 +1987,13 @@ angular.module('syncthing.core')
});
};
$scope.addFolderAndShare = function (folderID, folderLabel, device) {
$scope.addFolderAndShare = function (folderID, pendingFolder, device) {
addFolderInit(folderID).then(function() {
$scope.currentFolder.viewFlags = {
importFromOtherDevice: true
};
$scope.currentSharing.selected[device] = true;
$scope.currentFolder.label = folderLabel;
$scope.currentFolder.label = pendingFolder.offeredBy[device].label;
editFolderModal();
});
};
@@ -198,7 +198,7 @@
<div class="row">
<div class="col-md-6">
<label>
<input type="checkbox" ng-model="currentFolder.fsWatcherEnabled" ng-change="fsWatcherToggled()" tooltip data-original-title="{{'Use notifications from the filesystem to detect changed items.' | translate }}">&nbsp;<span translate>Watch for Changes</span>
<input type="checkbox" ng-model="currentFolder.fsWatcherEnabled" ng-change="setFSWatcherIntervalDefault()" tooltip data-original-title="{{'Use notifications from the filesystem to detect changed items.' | translate }}">&nbsp;<span translate>Watch for Changes</span>
</label>
<p translate class="help-block">Watching for changes discovers most changes without periodic scanning.</p>
</div>