diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 25f7afc8a..7d764967f 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -1739,6 +1739,7 @@ angular.module('syncthing.core') $scope.currentFolder.trashcanFileVersioning = true; $scope.currentFolder.fileVersioningSelector = "trashcan"; $scope.currentFolder.trashcanClean = +$scope.currentFolder.versioning.params.cleanoutDays; + $scope.currentFolder.versioningCleanupIntervalS = +$scope.currentFolder.versioning.cleanupIntervalS; } else if ($scope.currentFolder.versioning && $scope.currentFolder.versioning.type === "simple") { $scope.currentFolder.simpleFileVersioning = true; $scope.currentFolder.fileVersioningSelector = "simple"; @@ -1749,6 +1750,7 @@ angular.module('syncthing.core') $scope.currentFolder.staggeredMaxAge = Math.floor(+$scope.currentFolder.versioning.params.maxAge / 86400); $scope.currentFolder.staggeredCleanInterval = +$scope.currentFolder.versioning.params.cleanInterval; $scope.currentFolder.staggeredVersionsPath = $scope.currentFolder.versioning.params.versionsPath; + $scope.currentFolder.versioningCleanupIntervalS = +$scope.currentFolder.versioning.cleanupIntervalS; } else if ($scope.currentFolder.versioning && $scope.currentFolder.versioning.type === "external") { $scope.currentFolder.externalFileVersioning = true; $scope.currentFolder.fileVersioningSelector = "external"; @@ -1760,6 +1762,7 @@ angular.module('syncthing.core') $scope.currentFolder.simpleKeep = $scope.currentFolder.simpleKeep || 5; $scope.currentFolder.staggeredCleanInterval = $scope.currentFolder.staggeredCleanInterval || 3600; $scope.currentFolder.staggeredVersionsPath = $scope.currentFolder.staggeredVersionsPath || ""; + $scope.currentFolder.versioningCleanupIntervalS = $scope.currentFolder.versioningCleanupIntervalS || 0; // staggeredMaxAge can validly be zero, which we should not replace // with the default value of 365. So only set the default if it's @@ -1863,19 +1866,21 @@ angular.module('syncthing.core') if (folderCfg.fileVersioningSelector === "trashcan") { folderCfg.versioning = { - 'Type': 'trashcan', - 'Params': { + 'type': 'trashcan', + 'params': { 'cleanoutDays': '' + folderCfg.trashcanClean - } + }, + 'cleanupIntervalS': folderCfg.versioningCleanupIntervalS }; delete folderCfg.trashcanFileVersioning; delete folderCfg.trashcanClean; } else if (folderCfg.fileVersioningSelector === "simple") { folderCfg.versioning = { - 'Type': 'simple', - 'Params': { + 'type': 'simple', + 'params': { 'keep': '' + folderCfg.simpleKeep - } + }, + 'cleanupIntervalS': folderCfg.versioningCleanupIntervalS }; delete folderCfg.simpleFileVersioning; delete folderCfg.simpleKeep; @@ -1886,19 +1891,20 @@ angular.module('syncthing.core') 'maxAge': '' + (folderCfg.staggeredMaxAge * 86400), 'cleanInterval': '' + folderCfg.staggeredCleanInterval, 'versionsPath': '' + folderCfg.staggeredVersionsPath - } + }, + 'cleanupIntervalS': folderCfg.versioningCleanupIntervalS }; delete folderCfg.staggeredFileVersioning; delete folderCfg.staggeredMaxAge; delete folderCfg.staggeredCleanInterval; delete folderCfg.staggeredVersionsPath; - } else if (folderCfg.fileVersioningSelector === "external") { folderCfg.versioning = { - 'Type': 'external', - 'Params': { + 'type': 'external', + 'params': { 'command': '' + folderCfg.externalCommand - } + }, + 'cleanupIntervalS': folderCfg.versioningCleanupIntervalS }; delete folderCfg.externalFileVersioning; delete folderCfg.externalCommand; diff --git a/gui/default/syncthing/folder/editFolderModalView.html b/gui/default/syncthing/folder/editFolderModalView.html index d00177c05..1c7f11e1f 100644 --- a/gui/default/syncthing/folder/editFolderModalView.html +++ b/gui/default/syncthing/folder/editFolderModalView.html @@ -144,6 +144,18 @@ The path cannot be blank.

+
+ +
+ +
seconds
+
+

+ The interval, in seconds, for running cleanup in the versions directory. Zero to disable periodic cleaning. + The cleanup interval cannot be blank. + The interval must be a positive number of seconds. +

+