@@ -566,7 +566,7 @@
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="rescanFolder(folder.id)" ng-disabled="['idle', 'stopped', 'unshared', 'outofsync', 'faileditems', 'localadditions'].indexOf(folderStatus(folder)) < 0">
|
||||
<span class="fas fa-refresh"></span> <span translate>Rescan</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="editFolder(folder)">
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="editFolderExisting(folder)">
|
||||
<span class="fas fa-pencil-alt"></span> <span translate>Edit</span>
|
||||
</button>
|
||||
</span>
|
||||
@@ -833,7 +833,7 @@
|
||||
<button ng-if="deviceCfg.paused" type="button" class="btn btn-sm btn-default" ng-click="setDevicePause(deviceCfg.deviceID, false)">
|
||||
<span class="fas fa-play"></span> <span translate>Resume</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="editDevice(deviceCfg)">
|
||||
<button type="button" class="btn btn-sm btn-default" ng-click="editDeviceExisting(deviceCfg)">
|
||||
<span class="fas fa-pencil-alt"></span> <span translate>Edit</span>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
@@ -52,6 +52,7 @@ angular.module('syncthing.core')
|
||||
$scope.metricRates = false;
|
||||
$scope.folderPathErrors = {};
|
||||
$scope.currentFolder = {};
|
||||
$scope.currentDevice = {};
|
||||
$scope.ignores = {
|
||||
text: '',
|
||||
error: null,
|
||||
@@ -63,17 +64,8 @@ angular.module('syncthing.core')
|
||||
$scope.metricRates = (window.localStorage["metricRates"] == "true");
|
||||
} catch (exception) { }
|
||||
|
||||
$scope.folderDefaults = {
|
||||
devices: [],
|
||||
type: "sendreceive",
|
||||
rescanIntervalS: 3600,
|
||||
fsWatcherDelayS: 10,
|
||||
fsWatcherEnabled: true,
|
||||
minDiskFree: { value: 1, unit: "%" },
|
||||
maxConflicts: 10,
|
||||
fsync: true,
|
||||
order: "random",
|
||||
fileVersioningSelector: "none",
|
||||
$scope.versioningDefaults = {
|
||||
selector: "none",
|
||||
trashcanClean: 0,
|
||||
versioningCleanupIntervalS: 3600,
|
||||
simpleKeep: 5,
|
||||
@@ -81,8 +73,6 @@ angular.module('syncthing.core')
|
||||
staggeredCleanInterval: 3600,
|
||||
staggeredVersionsPath: "",
|
||||
externalCommand: "",
|
||||
autoNormalize: true,
|
||||
path: "",
|
||||
};
|
||||
|
||||
$scope.localStateTotal = {
|
||||
@@ -727,7 +717,7 @@ angular.module('syncthing.core')
|
||||
}
|
||||
|
||||
function shouldSetDefaultFolderPath() {
|
||||
return $scope.config.options && $scope.config.options.defaultFolderPath && !$scope.editingExisting && $scope.folderEditor.folderPath.$pristine
|
||||
return $scope.config.defaults.folder.path && !$scope.editingExisting && $scope.folderEditor.folderPath.$pristine && !$scope.editingDefaults;
|
||||
}
|
||||
|
||||
function resetRemoteNeed() {
|
||||
@@ -770,8 +760,26 @@ angular.module('syncthing.core')
|
||||
$scope.currentSharing.unrelated = [];
|
||||
$scope.currentSharing.selected = {};
|
||||
$scope.currentSharing.encryptionPasswords = {};
|
||||
if (editing === 'folder') {
|
||||
initShareEditingFolder();
|
||||
}
|
||||
};
|
||||
|
||||
function initShareEditingFolder() {
|
||||
$scope.currentFolder.devices.forEach(function (n) {
|
||||
if (n.deviceID !== $scope.myID) {
|
||||
$scope.currentSharing.shared.push($scope.devices[n.deviceID]);
|
||||
}
|
||||
if (n.encryptionPassword !== '') {
|
||||
$scope.currentSharing.encryptionPasswords[n.deviceID] = n.encryptionPassword;
|
||||
}
|
||||
$scope.currentSharing.selected[n.deviceID] = true;
|
||||
});
|
||||
$scope.currentSharing.unrelated = $scope.deviceList().filter(function (n) {
|
||||
return n.deviceID !== $scope.myID && !$scope.currentSharing.selected[n.deviceID];
|
||||
});
|
||||
}
|
||||
|
||||
$scope.refreshFailed = function (page, perpage) {
|
||||
if (!$scope.failed || !$scope.failed.folder) {
|
||||
return;
|
||||
@@ -1239,6 +1247,7 @@ angular.module('syncthing.core')
|
||||
}).error($scope.emitHTTPError);
|
||||
},
|
||||
show: function () {
|
||||
$scope.logging.paused = false;
|
||||
$scope.logging.refreshFacilities();
|
||||
$scope.logging.timer = $timeout($scope.logging.fetch);
|
||||
var textArea = $('#logViewerText');
|
||||
@@ -1496,9 +1505,40 @@ angular.module('syncthing.core')
|
||||
$scope.configInSync = true;
|
||||
};
|
||||
|
||||
$scope.editDevice = function (deviceCfg) {
|
||||
function editDeviceModal() {
|
||||
$scope.currentDevice._addressesStr = $scope.currentDevice.addresses.join(', ');
|
||||
$scope.deviceEditor.$setPristine();
|
||||
$('#editDevice').modal();
|
||||
}
|
||||
|
||||
$scope.editDeviceModalTitle = function() {
|
||||
if ($scope.editingDefaults) {
|
||||
return $translate.instant("Edit Device Defaults");
|
||||
}
|
||||
var title = '';
|
||||
if ($scope.editingExisting) {
|
||||
title += $translate.instant("Edit Device");
|
||||
} else {
|
||||
title += $translate.instant("Add Device");
|
||||
}
|
||||
var name = $scope.deviceName($scope.currentDevice);
|
||||
if (name !== '') {
|
||||
title += ' (' + name + ')';
|
||||
}
|
||||
return title;
|
||||
};
|
||||
|
||||
$scope.editDeviceModalIcon = function() {
|
||||
if ($scope.editingDefaults || $scope.editingExisting) {
|
||||
return 'fas fa-pencil-alt';
|
||||
}
|
||||
return 'fas fa-desktop';
|
||||
};
|
||||
|
||||
$scope.editDeviceExisting = function (deviceCfg) {
|
||||
$scope.currentDevice = $.extend({}, deviceCfg);
|
||||
$scope.editingExisting = true;
|
||||
$scope.editingDefaults = false;
|
||||
$scope.willBeReintroducedBy = undefined;
|
||||
if (deviceCfg.introducedBy) {
|
||||
var introducerDevice = $scope.devices[deviceCfg.introducedBy];
|
||||
@@ -1506,7 +1546,6 @@ angular.module('syncthing.core')
|
||||
$scope.willBeReintroducedBy = $scope.deviceName(introducerDevice);
|
||||
}
|
||||
}
|
||||
$scope.currentDevice._addressesStr = deviceCfg.addresses.join(', ');
|
||||
initShareEditing('device');
|
||||
$scope.deviceFolders($scope.currentDevice).forEach(function (folderID) {
|
||||
$scope.currentSharing.shared.push($scope.folders[folderID]);
|
||||
@@ -1522,8 +1561,15 @@ angular.module('syncthing.core')
|
||||
$scope.currentSharing.unrelated = $scope.folderList().filter(function (n) {
|
||||
return !$scope.currentSharing.selected[n.id];
|
||||
});
|
||||
$scope.deviceEditor.$setPristine();
|
||||
$('#editDevice').modal();
|
||||
editDeviceModal();
|
||||
};
|
||||
|
||||
$scope.editDeviceDefaults = function () {
|
||||
$http.get(urlbase + '/config/defaults/device').then(function (p) {
|
||||
$scope.currentDevice = p.data;
|
||||
$scope.editingDefaults = true;
|
||||
editDeviceModal();
|
||||
}, $scope.emitHTTPError);
|
||||
};
|
||||
|
||||
$scope.selectAllSharedFolders = function (state) {
|
||||
@@ -1555,19 +1601,16 @@ angular.module('syncthing.core')
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
$scope.currentDevice = {
|
||||
name: name,
|
||||
deviceID: deviceID,
|
||||
_addressesStr: 'dynamic',
|
||||
compression: 'metadata',
|
||||
introducer: false,
|
||||
ignoredFolders: []
|
||||
};
|
||||
$scope.editingExisting = false;
|
||||
initShareEditing('device');
|
||||
$scope.currentSharing.unrelated = $scope.folderList();
|
||||
$scope.deviceEditor.$setPristine();
|
||||
$('#editDevice').modal();
|
||||
$http.get(urlbase + '/config/defaults/device').then(function (p) {
|
||||
$scope.currentDevice = p.data;
|
||||
$scope.currentDevice.name = name;
|
||||
$scope.currentDevice.deviceID = deviceID;
|
||||
$scope.editingExisting = false;
|
||||
$scope.editingDefaults = false;
|
||||
initShareEditing('device');
|
||||
$scope.currentSharing.unrelated = $scope.folderList();
|
||||
editDeviceModal();
|
||||
}, $scope.emitHTTPError);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1592,22 +1635,30 @@ angular.module('syncthing.core')
|
||||
|
||||
$scope.saveDevice = function () {
|
||||
$('#editDevice').modal('hide');
|
||||
$scope.saveDeviceConfig($scope.currentDevice);
|
||||
};
|
||||
|
||||
$scope.saveDeviceConfig = function (deviceCfg) {
|
||||
deviceCfg.addresses = deviceCfg._addressesStr.split(',').map(function (x) {
|
||||
$scope.currentDevice.addresses = $scope.currentDevice._addressesStr.split(',').map(function (x) {
|
||||
return x.trim();
|
||||
});
|
||||
delete $scope.currentDevice._addressesStr;
|
||||
if ($scope.editingDefaults) {
|
||||
$scope.config.defaults.device = $scope.currentDevice;
|
||||
} else {
|
||||
setDeviceConfig();
|
||||
}
|
||||
delete $scope.currentSharing;
|
||||
delete $scope.currentDevice;
|
||||
$scope.saveConfig();
|
||||
};
|
||||
|
||||
$scope.devices[deviceCfg.deviceID] = deviceCfg;
|
||||
function setDeviceConfig() {
|
||||
var currentID = $scope.currentDevice.DeviceID;
|
||||
$scope.devices[currentID] = $scope.currentDevice;
|
||||
$scope.config.devices = deviceList($scope.devices);
|
||||
|
||||
for (var id in $scope.currentSharing.selected) {
|
||||
if ($scope.currentSharing.selected[id]) {
|
||||
var found = false;
|
||||
for (i = 0; i < $scope.folders[id].devices.length; i++) {
|
||||
if ($scope.folders[id].devices[i].deviceID === deviceCfg.deviceID) {
|
||||
if ($scope.folders[id].devices[i].deviceID === currentID) {
|
||||
found = true;
|
||||
// Update encryption pw
|
||||
$scope.folders[id].devices[i].encryptionPassword = $scope.currentSharing.encryptionPasswords[id];
|
||||
@@ -1618,22 +1669,19 @@ angular.module('syncthing.core')
|
||||
if (!found) {
|
||||
// Add device to folder
|
||||
$scope.folders[id].devices.push({
|
||||
deviceID: deviceCfg.deviceID,
|
||||
encryptionPassword: $scope.currentSharing.encryptionPasswords[id]
|
||||
deviceID: currentID,
|
||||
encryptionPassword: $scope.currentSharing.encryptionPasswords[id],
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Remove device from folder
|
||||
$scope.folders[id].devices = $scope.folders[id].devices.filter(function (n) {
|
||||
return n.deviceID !== deviceCfg.deviceID;
|
||||
return n.deviceID !== currentID;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
delete $scope.currentSharing;
|
||||
|
||||
$scope.config.folders = folderList($scope.folders);
|
||||
$scope.saveConfig();
|
||||
};
|
||||
|
||||
$scope.ignoreDevice = function (deviceID, pendingDevice) {
|
||||
@@ -1770,14 +1818,14 @@ angular.module('syncthing.core')
|
||||
if (!newvalue || !shouldSetDefaultFolderPath()) {
|
||||
return;
|
||||
}
|
||||
$scope.currentFolder.path = pathJoin($scope.config.options.defaultFolderPath, newvalue);
|
||||
$scope.currentFolder.path = pathJoin($scope.config.defaults.folder.path, newvalue);
|
||||
});
|
||||
|
||||
$scope.$watch('currentFolder.id', function (newvalue) {
|
||||
if (!newvalue || !shouldSetDefaultFolderPath() || $scope.currentFolder.label) {
|
||||
return;
|
||||
}
|
||||
$scope.currentFolder.path = pathJoin($scope.config.options.defaultFolderPath, newvalue);
|
||||
$scope.currentFolder.path = pathJoin($scope.config.defaults.folder.path, newvalue);
|
||||
});
|
||||
|
||||
$scope.fsWatcherToggled = function () {
|
||||
@@ -1804,7 +1852,8 @@ angular.module('syncthing.core')
|
||||
$('#globalChanges').modal();
|
||||
};
|
||||
|
||||
$scope.editFolderModal = function () {
|
||||
function editFolderModal() {
|
||||
initVersioningEditing();
|
||||
$scope.folderPathErrors = {};
|
||||
$scope.folderEditor.$setPristine();
|
||||
$('#editFolder').modal().one('shown.bs.tab', function (e) {
|
||||
@@ -1817,67 +1866,78 @@ angular.module('syncthing.core')
|
||||
});
|
||||
};
|
||||
|
||||
$scope.editFolder = function (folderCfg) {
|
||||
$scope.editingExisting = true;
|
||||
$scope.currentFolder = angular.copy(folderCfg);
|
||||
$scope.editFolderModalTitle = function() {
|
||||
if ($scope.editingDefaults) {
|
||||
return $translate.instant("Edit Folder Defaults");
|
||||
}
|
||||
var title = '';
|
||||
if ($scope.editingExisting) {
|
||||
title += $translate.instant("Edit Folder");
|
||||
} else {
|
||||
title += $translate.instant("Add Folder");
|
||||
}
|
||||
if ($scope.currentFolder.id !== '') {
|
||||
title += ' (' + $scope.folderLabel($scope.currentFolder.id) + ')';
|
||||
}
|
||||
return title;
|
||||
};
|
||||
|
||||
$scope.editFolderModalIcon = function() {
|
||||
if ($scope.editingDefaults || $scope.editingExisting) {
|
||||
return 'fas fa-pencil-alt';
|
||||
}
|
||||
return 'fas fa-folder';
|
||||
};
|
||||
|
||||
function editFolder() {
|
||||
if ($scope.currentFolder.path.length > 1 && $scope.currentFolder.path.slice(-1) === $scope.system.pathSeparator) {
|
||||
$scope.currentFolder.path = $scope.currentFolder.path.slice(0, -1);
|
||||
} else if (!$scope.currentFolder.path) {
|
||||
// undefined path leads to invalid input field
|
||||
$scope.currentFolder.path = '';
|
||||
}
|
||||
// Cache complete device objects indexed by ID for lookups
|
||||
initShareEditing('folder');
|
||||
$scope.currentFolder.devices.forEach(function (n) {
|
||||
if (n.deviceID !== $scope.myID) {
|
||||
$scope.currentSharing.shared.push($scope.devices[n.deviceID]);
|
||||
}
|
||||
if (n.encryptionPassword !== '') {
|
||||
$scope.currentSharing.encryptionPasswords[n.deviceID] = n.encryptionPassword;
|
||||
}
|
||||
$scope.currentSharing.selected[n.deviceID] = true;
|
||||
});
|
||||
$scope.currentSharing.unrelated = $scope.deviceList().filter(function (n) {
|
||||
return n.deviceID !== $scope.myID && !$scope.currentSharing.selected[n.deviceID];
|
||||
});
|
||||
if ($scope.currentFolder.versioning && $scope.currentFolder.versioning.type === "trashcan") {
|
||||
$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";
|
||||
$scope.currentFolder.simpleKeep = +$scope.currentFolder.versioning.params.keep;
|
||||
$scope.currentFolder.versioningCleanupIntervalS = +$scope.currentFolder.versioning.cleanupIntervalS;
|
||||
$scope.currentFolder.trashcanClean = +$scope.currentFolder.versioning.params.cleanoutDays;
|
||||
} else if ($scope.currentFolder.versioning && $scope.currentFolder.versioning.type === "staggered") {
|
||||
$scope.currentFolder.staggeredFileVersioning = true;
|
||||
$scope.currentFolder.fileVersioningSelector = "staggered";
|
||||
$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";
|
||||
$scope.currentFolder.externalCommand = $scope.currentFolder.versioning.params.command;
|
||||
} else {
|
||||
$scope.currentFolder.fileVersioningSelector = "none";
|
||||
}
|
||||
$scope.currentFolder.trashcanClean = $scope.currentFolder.trashcanClean || 0; // weeds out nulls and undefineds
|
||||
$scope.currentFolder.simpleKeep = $scope.currentFolder.simpleKeep || 5;
|
||||
$scope.currentFolder.staggeredCleanInterval = $scope.currentFolder.staggeredCleanInterval || 3600;
|
||||
$scope.currentFolder.staggeredVersionsPath = $scope.currentFolder.staggeredVersionsPath || "";
|
||||
// Zero is a valid, non-default value (disabled)
|
||||
if ($scope.currentFolder.versioningCleanupIntervalS !== 0) {
|
||||
$scope.currentFolder.versioningCleanupIntervalS = $scope.currentFolder.versioningCleanupIntervalS || 3600;
|
||||
editFolderModal();
|
||||
}
|
||||
|
||||
function initVersioningEditing() {
|
||||
$scope.currentFolder._guiVersioning = angular.copy($scope.versioningDefaults);
|
||||
|
||||
if (!$scope.currentFolder.versioning) {
|
||||
return;
|
||||
}
|
||||
|
||||
// staggeredMaxAge can validly be zero, which we should not replace
|
||||
// with the default value of 365. So only set the default if it's
|
||||
// actually undefined.
|
||||
if (typeof $scope.currentFolder.staggeredMaxAge === 'undefined') {
|
||||
$scope.currentFolder.staggeredMaxAge = 365;
|
||||
var currentVersioning = $scope.currentFolder.versioning;
|
||||
|
||||
$scope.currentFolder._guiVersioning.cleanupIntervalS = +currentVersioning.cleanupIntervalS;
|
||||
|
||||
// Apply parameters currently in use
|
||||
switch (currentVersioning.type) {
|
||||
case "trashcan":
|
||||
$scope.currentFolder._guiVersioning.selector = "trashcan";
|
||||
$scope.currentFolder._guiVersioning.trashcanClean = +currentVersioning.params.cleanoutDays;
|
||||
break;
|
||||
case "simple":
|
||||
$scope.currentFolder._guiVersioning.selector = "simple";
|
||||
$scope.currentFolder._guiVersioning.simpleKeep = +currentVersioning.params.keep;
|
||||
$scope.currentFolder._guiVersioning.trashcanClean = +currentVersioning.params.cleanoutDays;
|
||||
break;
|
||||
case "staggered":
|
||||
$scope.currentFolder._guiVersioning.selector = "staggered";
|
||||
$scope.currentFolder._guiVersioning.staggeredMaxAge = Math.floor(+currentVersioning.params.maxAge / 86400);
|
||||
$scope.currentFolder._guiVersioning.staggeredCleanInterval = +currentVersioning.params.cleanInterval;
|
||||
$scope.currentFolder._guiVersioning.staggeredVersionsPath = currentVersioning.params.versionsPath;
|
||||
break;
|
||||
case "external":
|
||||
$scope.currentFolder._guiVersioning.selector = "external";
|
||||
$scope.currentFolder.externalCommand = currentVersioning.params.command;
|
||||
break;
|
||||
}
|
||||
$scope.currentFolder.externalCommand = $scope.currentFolder.externalCommand || "";
|
||||
};
|
||||
|
||||
$scope.editFolderExisting = function(folderCfg) {
|
||||
$scope.editingExisting = true;
|
||||
$scope.currentFolder = angular.copy(folderCfg);
|
||||
|
||||
$scope.ignores.text = 'Loading...';
|
||||
$scope.ignores.error = null;
|
||||
@@ -1894,7 +1954,18 @@ angular.module('syncthing.core')
|
||||
$scope.emitHTTPError(err);
|
||||
});
|
||||
|
||||
$scope.editFolderModal();
|
||||
editFolder();
|
||||
};
|
||||
|
||||
$scope.editFolderDefaults = function() {
|
||||
$http.get(urlbase + '/config/defaults/folder')
|
||||
.success(function (data) {
|
||||
$scope.currentFolder = data;
|
||||
$scope.editingExisting = false;
|
||||
$scope.editingDefaults = true;
|
||||
editFolder();
|
||||
})
|
||||
.error($scope.emitHTTPError);
|
||||
};
|
||||
|
||||
$scope.selectAllSharedDevices = function (state) {
|
||||
@@ -1913,37 +1984,43 @@ angular.module('syncthing.core')
|
||||
|
||||
$scope.addFolder = function () {
|
||||
$http.get(urlbase + '/svc/random/string?length=10').success(function (data) {
|
||||
$scope.editingExisting = false;
|
||||
$scope.currentFolder = angular.copy($scope.folderDefaults);
|
||||
initShareEditing('folder');
|
||||
$scope.currentFolder.id = (data.random.substr(0, 5) + '-' + data.random.substr(5, 5)).toLowerCase();
|
||||
$scope.currentSharing.unrelated = $scope.otherDevices();
|
||||
$scope.ignores.text = '';
|
||||
$scope.ignores.error = null;
|
||||
$scope.ignores.disabled = false;
|
||||
$scope.editFolderModal();
|
||||
var folderID = (data.random.substr(0, 5) + '-' + data.random.substr(5, 5)).toLowerCase();
|
||||
addFolderInit(folderID).then(function() {
|
||||
// Triggers the watch that sets the path
|
||||
$scope.currentFolder.label = $scope.currentFolder.label;
|
||||
editFolderModal();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.addFolderAndShare = function (folder, folderLabel, device) {
|
||||
$scope.editingExisting = false;
|
||||
$scope.currentFolder = angular.copy($scope.folderDefaults);
|
||||
$scope.currentFolder.id = folder;
|
||||
$scope.currentFolder.label = folderLabel;
|
||||
$scope.currentFolder.viewFlags = {
|
||||
importFromOtherDevice: true
|
||||
};
|
||||
initShareEditing('folder');
|
||||
$scope.currentSharing.selected[device] = true;
|
||||
$scope.currentSharing.unrelated = $scope.deviceList().filter(function (n) {
|
||||
return n.deviceID !== $scope.myID;
|
||||
$scope.addFolderAndShare = function (folderID, folderLabel, device) {
|
||||
addFolderInit(folderID).then(function() {
|
||||
$scope.currentFolder.viewFlags = {
|
||||
importFromOtherDevice: true
|
||||
};
|
||||
$scope.currentSharing.selected[device] = true;
|
||||
$scope.currentFolder.label = folderLabel;
|
||||
editFolderModal();
|
||||
});
|
||||
$scope.ignores.text = '';
|
||||
$scope.ignores.error = null;
|
||||
$scope.ignores.disabled = false;
|
||||
$scope.editFolderModal();
|
||||
};
|
||||
|
||||
function addFolderInit(folderID) {
|
||||
$scope.editingExisting = false;
|
||||
$scope.editingDefaults = false;
|
||||
return $http.get(urlbase + '/config/defaults/folder').then(function(p) {
|
||||
$scope.currentFolder = p.data;
|
||||
$scope.currentFolder.id = folderID;
|
||||
|
||||
initShareEditing('folder');
|
||||
$scope.currentSharing.unrelated = $scope.currentSharing.unrelated.concat($scope.currentSharing.shared);
|
||||
$scope.currentSharing.shared = [];
|
||||
|
||||
$scope.ignores.text = '';
|
||||
$scope.ignores.error = null;
|
||||
$scope.ignores.disabled = false;
|
||||
}, $scope.emitHTTPError);
|
||||
}
|
||||
|
||||
$scope.shareFolderWithDevice = function (folder, device) {
|
||||
$scope.folders[folder].devices.push({
|
||||
deviceID: device
|
||||
@@ -1975,55 +2052,60 @@ angular.module('syncthing.core')
|
||||
folderCfg.devices = newDevices;
|
||||
delete $scope.currentSharing;
|
||||
|
||||
if (folderCfg.fileVersioningSelector === "trashcan") {
|
||||
switch (folderCfg._guiVersioning.selector) {
|
||||
case "trashcan":
|
||||
folderCfg.versioning = {
|
||||
'type': 'trashcan',
|
||||
'params': {
|
||||
'cleanoutDays': '' + folderCfg.trashcanClean
|
||||
'cleanoutDays': '' + folderCfg._guiVersioning.trashcanClean
|
||||
},
|
||||
'cleanupIntervalS': folderCfg.versioningCleanupIntervalS
|
||||
'cleanupIntervalS': folderCfg._guiVersioning.cleanupIntervalS
|
||||
};
|
||||
delete folderCfg.trashcanFileVersioning;
|
||||
delete folderCfg.trashcanClean;
|
||||
} else if (folderCfg.fileVersioningSelector === "simple") {
|
||||
break;
|
||||
case "simple":
|
||||
folderCfg.versioning = {
|
||||
'type': 'simple',
|
||||
'params': {
|
||||
'keep': '' + folderCfg.simpleKeep,
|
||||
'cleanoutDays': '' + folderCfg.trashcanClean
|
||||
'keep': '' + folderCfg._guiVersioning.simpleKeep,
|
||||
'cleanoutDays': '' + folderCfg._guiVersioning.trashcanClean
|
||||
},
|
||||
'cleanupIntervalS': folderCfg.versioningCleanupIntervalS
|
||||
'cleanupIntervalS': folderCfg._guiVersioning.cleanupIntervalS
|
||||
};
|
||||
delete folderCfg.simpleFileVersioning;
|
||||
delete folderCfg.simpleKeep;
|
||||
} else if (folderCfg.fileVersioningSelector === "staggered") {
|
||||
break;
|
||||
case "staggered":
|
||||
folderCfg.versioning = {
|
||||
'type': 'staggered',
|
||||
'params': {
|
||||
'maxAge': '' + (folderCfg.staggeredMaxAge * 86400),
|
||||
'cleanInterval': '' + folderCfg.staggeredCleanInterval,
|
||||
'versionsPath': '' + folderCfg.staggeredVersionsPath
|
||||
'maxAge': '' + (folderCfg._guiVersioning.staggeredMaxAge * 86400),
|
||||
'cleanInterval': '' + folderCfg._guiVersioning.staggeredCleanInterval,
|
||||
'versionsPath': '' + folderCfg._guiVersioning.staggeredVersionsPath
|
||||
},
|
||||
'cleanupIntervalS': folderCfg.versioningCleanupIntervalS
|
||||
'cleanupIntervalS': folderCfg._guiVersioning.cleanupIntervalS
|
||||
};
|
||||
delete folderCfg.staggeredFileVersioning;
|
||||
delete folderCfg.staggeredMaxAge;
|
||||
delete folderCfg.staggeredCleanInterval;
|
||||
delete folderCfg.staggeredVersionsPath;
|
||||
} else if (folderCfg.fileVersioningSelector === "external") {
|
||||
break;
|
||||
case "external":
|
||||
folderCfg.versioning = {
|
||||
'type': 'external',
|
||||
'params': {
|
||||
'command': '' + folderCfg.externalCommand
|
||||
'command': '' + folderCfg._guiVersioning.externalCommand
|
||||
},
|
||||
'cleanupIntervalS': folderCfg.versioningCleanupIntervalS
|
||||
'cleanupIntervalS': folderCfg._guiVersioning.cleanupIntervalS
|
||||
};
|
||||
delete folderCfg.externalFileVersioning;
|
||||
delete folderCfg.externalCommand;
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
delete folderCfg.versioning;
|
||||
}
|
||||
delete folderCfg._guiVersioning;
|
||||
|
||||
if ($scope.editingDefaults) {
|
||||
$scope.config.defaults.folder = folderCfg;
|
||||
$scope.saveConfig();
|
||||
} else {
|
||||
saveFolderExisting(folderCfg);
|
||||
}
|
||||
};
|
||||
|
||||
function saveFolderExisting(folderCfg) {
|
||||
var ignoresLoaded = !$scope.ignores.disabled;
|
||||
var ignores = $scope.ignores.text.split('\n');
|
||||
// Split always returns a minimum 1-length array even for no patterns
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<modal id="editDevice" status="default" icon="{{editingExisting ? 'fas fa-pencil-alt' : 'fas fa-desktop'}}" heading="{{editingExisting ? 'Edit Device' : 'Add Device' | translate}} {{currentDevice.name}}" large="yes" closeable="yes">
|
||||
<modal id="editDevice" status="default" icon="{{editDeviceModalIcon()}}" heading="{{editDeviceModalTitle()}}" large="yes" closeable="yes">
|
||||
<div class="modal-body">
|
||||
<form role="form" name="deviceEditor">
|
||||
<ul class="nav nav-tabs" ng-init="loadFormIntoScope(deviceEditor)">
|
||||
<li class="active"><a data-toggle="tab" href="#device-general"><span class="fas fa-cog"></span> <span translate>General</span></a></li>
|
||||
<li><a data-toggle="tab" href="#device-sharing"><span class="fas fa-share-alt"></span> <span translate>Sharing</span></a></li>
|
||||
<li ng-if="!editingDefaults"><a data-toggle="tab" href="#device-sharing"><span class="fas fa-share-alt"></span> <span translate>Sharing</span></a></li>
|
||||
<li><a data-toggle="tab" href="#device-advanced"><span class="fas fa-cogs"></span> <span translate>Advanced</span></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="device-general" class="tab-pane in active">
|
||||
<div class="form-group" ng-class="{'has-error': deviceEditor.deviceID.$invalid && deviceEditor.deviceID.$dirty}" ng-init="loadFormIntoScope(deviceEditor)">
|
||||
<div ng-if="!editingDefaults" class="form-group" ng-class="{'has-error': deviceEditor.deviceID.$invalid && deviceEditor.deviceID.$dirty}" ng-init="loadFormIntoScope(deviceEditor)">
|
||||
<label translate for="deviceID">Device ID</label>
|
||||
<div ng-if="!editingExisting">
|
||||
<input name="deviceID" id="deviceID" class="form-control text-monospace" type="text" ng-model="currentDevice.deviceID" required="" valid-deviceid list="discovery-list" aria-required="true" />
|
||||
@@ -38,7 +38,7 @@
|
||||
<p translate ng-if="currentDevice.deviceID != myID" class="help-block">Shown instead of Device ID in the cluster status. Will be updated to the name the device advertises if left empty.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="device-sharing" class="tab-pane">
|
||||
<div ng-if="!editingDefaults" id="device-sharing" class="tab-pane">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
@@ -151,13 +151,13 @@
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-click="saveDevice()" ng-disabled="deviceEditor.$invalid">
|
||||
<span class="fas fa-check"></span> <span translate>Save</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#idqr" ng-if="editingExisting || deviceEditor.deviceID.$valid">
|
||||
<button ng-if="!editingDefaults" type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#idqr" ng-if="editingExisting || deviceEditor.deviceID.$valid">
|
||||
<span class="fas fa-qrcode"></span> <span translate>Show QR</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
||||
<span class="fas fa-times"></span> <span translate>Close</span>
|
||||
</button>
|
||||
<div ng-if="editingExisting" class="pull-left">
|
||||
<div ng-if="editingExisting && !editingDefaults" class="pull-left">
|
||||
<button type="button" class="btn btn-warning btn-sm" data-toggle="modal" data-target="#remove-device-confirmation">
|
||||
<span class="fas fa-minus-circle"></span> <span translate>Remove</span>
|
||||
</button>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<modal id="editFolder" status="default" icon="{{editingExisting ? 'fas fa-pencil-alt' : 'fas fa-folder'}}" heading="{{editingExisting ? 'Edit Folder' : 'Add Folder' | translate}} ({{folderLabel(currentFolder.id)}})" large="yes" closeable="yes">
|
||||
<modal id="editFolder" status="default" icon="{{editFolderModalIcon()}}" heading="{{editFolderModalTitle()}}" large="yes" closeable="yes">
|
||||
<div class="modal-body">
|
||||
<form role="form" name="folderEditor">
|
||||
<ul class="nav nav-tabs" ng-init="loadFormIntoScope(folderEditor)">
|
||||
<li class="active"><a data-toggle="tab" href="#folder-general"><span class="fas fa-cog"></span> <span translate>General</span></a></li>
|
||||
<li><a data-toggle="tab" href="#folder-sharing"><span class="fas fa-share-alt"></span> <span translate>Sharing</span></a></li>
|
||||
<li><a data-toggle="tab" href="#folder-versioning"><span class="fas fa-copy"></span> <span translate>File Versioning</span></a></li>
|
||||
<li><a data-toggle="tab" href="#folder-ignores"><span class="fas fa-filter"></span> <span translate>Ignore Patterns</span></a></li>
|
||||
<li ng-if="!editingDefaults"><a data-toggle="tab" href="#folder-ignores"><span class="fas fa-filter"></span> <span translate>Ignore Patterns</span></a></li>
|
||||
<li><a data-toggle="tab" href="#folder-advanced"><span class="fas fa-cogs"></span> <span translate>Advanced</span></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
|
||||
<div id="folder-general" class="tab-pane in active">
|
||||
<div class="form-group" ng-class="{'has-error': folderEditor.folderLabel.$invalid && folderEditor.folderLabel.$dirty}">
|
||||
<div class="form-group" ng-class="{'has-error': folderEditor.folderLabel.$invalid && folderEditor.folderLabel.$dirty && !editingDefaults}">
|
||||
<label for="folderLabel"><span translate>Folder Label</span></label>
|
||||
<input name="folderLabel" id="folderLabel" class="form-control" type="text" ng-model="currentFolder.label" value="{{currentFolder.label}}" />
|
||||
<p class="help-block">
|
||||
<span translate ng-if="folderEditor.folderLabel.$valid || folderEditor.folderLabel.$pristine">Optional descriptive label for the folder. Can be different on each device.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{'has-error': folderEditor.folderID.$invalid && folderEditor.folderID.$dirty}">
|
||||
<div ng-if="!editingDefaults" class="form-group" ng-class="{'has-error': folderEditor.folderID.$invalid && folderEditor.folderID.$dirty}">
|
||||
<label for="folderID"><span translate>Folder ID</span></label>
|
||||
<input name="folderID" ng-readonly="editingExisting || (!editingExisting && currentFolder.viewFlags.importFromOtherDevice)" id="folderID" class="form-control" type="text" ng-model="currentFolder.id" required="" aria-required="true" unique-folder value="{{currentFolder.id}}" />
|
||||
<p class="help-block">
|
||||
@@ -28,19 +28,21 @@
|
||||
<span translate ng-show="!editingExisting">When adding a new folder, keep in mind that the Folder ID is used to tie folders together between devices. They are case sensitive and must match exactly between all devices.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{'has-error': folderEditor.folderPath.$invalid && folderEditor.folderPath.$dirty}">
|
||||
<div class="form-group" ng-class="{'has-error': folderEditor.folderPath.$invalid && folderEditor.folderPath.$dirty && !editingDefaults}">
|
||||
<label translate for="folderPath">Folder Path</label>
|
||||
<input name="folderPath" ng-readonly="editingExisting" id="folderPath" class="form-control" type="text" ng-model="currentFolder.path" list="directory-list" required="" aria-required="true" path-is-sub-dir />
|
||||
<input name="folderPath" ng-readonly="editingExisting && !editingDefaults" id="folderPath" class="form-control" type="text" ng-model="currentFolder.path" list="directory-list" ng-required="!editingDefaults" ng-aria-required="!editingDefaults" path-is-sub-dir />
|
||||
<datalist id="directory-list">
|
||||
<option ng-repeat="directory in directoryList" value="{{ directory }}" />
|
||||
</datalist>
|
||||
<p class="help-block">
|
||||
<span ng-if="folderEditor.folderPath.$valid || folderEditor.folderPath.$pristine"><span translate>Path to the folder on the local computer. Will be created if it does not exist. The tilde character (~) can be used as a shortcut for</span> <code>{{system.tilde}}</code>.</br></span>
|
||||
<span translate ng-if="folderEditor.folderPath.$error.required && folderEditor.folderPath.$dirty">The folder path cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor.folderPath.$error.required && folderEditor.folderPath.$dirty && !editingDefaults">The folder path cannot be blank.</span>
|
||||
<span class="text-danger" translate translate-value-other-folder="{{folderPathErrors.otherID}}" ng-if="folderPathErrors.isSub && folderPathErrors.otherLabel.length == 0">Warning, this path is a subdirectory of an existing folder "{%otherFolder%}".</span>
|
||||
<span class="text-danger" translate translate-value-other-folder="{{folderPathErrors.otherID}}" translate-value-other-folder-label="{{folderPathErrors.otherLabel}}" ng-if="folderPathErrors.isSub && folderPathErrors.otherLabel.length != 0">Warning, this path is a subdirectory of an existing folder "{%otherFolderLabel%}" ({%otherFolder%}).</span>
|
||||
<span class="text-danger" translate translate-value-other-folder="{{folderPathErrors.otherID}}" ng-if="folderPathErrors.isParent && folderPathErrors.otherLabel.length == 0">Warning, this path is a parent directory of an existing folder "{%otherFolder%}".</span>
|
||||
<span class="text-danger" translate translate-value-other-folder="{{folderPathErrors.otherID}}" translate-value-other-folder-label="{{folderPathErrors.otherLabel}}" ng-if="folderPathErrors.isParent && folderPathErrors.otherLabel.length != 0">Warning, this path is a parent directory of an existing folder "{%otherFolderLabel%}" ({%otherFolder%}).</span>
|
||||
<span ng-if="folderPathErrors.isParent && !editingDefaults">
|
||||
<span class="text-danger" translate translate-value-other-folder="{{folderPathErrors.otherID}}" ng-if="folderPathErrors.otherLabel.length == 0">Warning, this path is a parent directory of an existing folder "{%otherFolder%}".</span>
|
||||
<span class="text-danger" translate translate-value-other-folder="{{folderPathErrors.otherID}}" translate-value-other-folder-label="{{folderPathErrors.otherLabel}}" ng-if="folderPathErrors.otherLabel.length != 0">Warning, this path is a parent directory of an existing folder "{%otherFolderLabel%}" ({%otherFolder%}).</span>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,7 +78,7 @@
|
||||
<div id="folder-versioning" class="tab-pane">
|
||||
<div class="form-group">
|
||||
<label translate>File Versioning</label> <a href="https://docs.syncthing.net/users/versioning.html" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<select class="form-control" ng-model="currentFolder.fileVersioningSelector">
|
||||
<select class="form-control" ng-model="currentFolder._guiVersioning.selector">
|
||||
<option value="none" translate>No File Versioning</option>
|
||||
<option value="trashcan" translate>Trash Can File Versioning</option>
|
||||
<option value="simple" translate>Simple File Versioning</option>
|
||||
@@ -84,46 +86,46 @@
|
||||
<option value="external" translate>External File Versioning</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" ng-if="currentFolder.fileVersioningSelector=='trashcan' || currentFolder.fileVersioningSelector=='simple'" ng-class="{'has-error': folderEditor.trashcanClean.$invalid && folderEditor.trashcanClean.$dirty}">
|
||||
<div class="form-group" ng-if="currentFolder._guiVersioning.selector=='trashcan' || currentFolder._guiVersioning.selectorector=='simple'" ng-class="{'has-error': folderEditor._guiVersioning.trashcanClean.$invalid && folderEditor._guiVersioning.trashcanClean.$dirty}">
|
||||
<p translate class="help-block">Files are moved to .stversions directory when replaced or deleted by Syncthing.</p>
|
||||
<label translate for="trashcanClean">Clean out after</label>
|
||||
<div class="input-group">
|
||||
<input name="trashcanClean" id="trashcanClean" class="form-control text-right" type="number" ng-model="currentFolder.trashcanClean" required="" aria-required="true" min="0" />
|
||||
<input name="trashcanClean" id="trashcanClean" class="form-control text-right" type="number" ng-model="currentFolder._guiVersioning.trashcanClean" required="" aria-required="true" min="0" />
|
||||
<div class="input-group-addon" translate>days</div>
|
||||
</div>
|
||||
<p class="help-block">
|
||||
<span translate ng-if="folderEditor.trashcanClean.$valid || folderEditor.trashcanClean.$pristine">The number of days to keep files in the trash can. Zero means forever.</span>
|
||||
<span translate ng-if="folderEditor.trashcanClean.$error.required && folderEditor.trashcanClean.$dirty">The number of days must be a number and cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor.trashcanClean.$error.min && folderEditor.trashcanClean.$dirty">A negative number of days doesn't make sense.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.trashcanClean.$valid || folderEditor._guiVersioning.trashcanClean.$pristine">The number of days to keep files in the trash can. Zero means forever.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.trashcanClean.$error.required && folderEditor._guiVersioning.trashcanClean.$dirty">The number of days must be a number and cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.trashcanClean.$error.min && folderEditor._guiVersioning.trashcanClean.$dirty">A negative number of days doesn't make sense.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-if="currentFolder.fileVersioningSelector=='simple'" ng-class="{'has-error': folderEditor.simpleKeep.$invalid && folderEditor.simpleKeep.$dirty}">
|
||||
<div class="form-group" ng-if="currentFolder._guiVersioning.selector=='simple'" ng-class="{'has-error': folderEditor._guiVersioning.simpleKeep.$invalid && folderEditor._guiVersioning.simpleKeep.$dirty}">
|
||||
<p translate class="help-block">Files are moved to date stamped versions in a .stversions directory when replaced or deleted by Syncthing.</p>
|
||||
<label translate for="simpleKeep">Keep Versions</label>
|
||||
<input name="simpleKeep" id="simpleKeep" class="form-control" type="number" ng-model="currentFolder.simpleKeep" required="" aria-required="true" min="1" />
|
||||
<input name="simpleKeep" id="simpleKeep" class="form-control" type="number" ng-model="currentFolder._guiVersioning.simpleKeep" required="" aria-required="true" min="1" />
|
||||
<p class="help-block">
|
||||
<span translate ng-if="folderEditor.simpleKeep.$valid || folderEditor.simpleKeep.$pristine">The number of old versions to keep, per file.</span>
|
||||
<span translate ng-if="folderEditor.simpleKeep.$error.required && folderEditor.simpleKeep.$dirty">The number of versions must be a number and cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor.simpleKeep.$error.min && folderEditor.simpleKeep.$dirty">You must keep at least one version.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.simpleKeep.$valid || folderEditor._guiVersioning.simpleKeep.$pristine">The number of old versions to keep, per file.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.simpleKeep.$error.required && folderEditor._guiVersioning.simpleKeep.$dirty">The number of versions must be a number and cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.simpleKeep.$error.min && folderEditor._guiVersioning.simpleKeep.$dirty">You must keep at least one version.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-if="currentFolder.fileVersioningSelector=='staggered'" ng-class="{'has-error': folderEditor.staggeredMaxAge.$invalid && folderEditor.staggeredMaxAge.$dirty}">
|
||||
<div class="form-group" ng-if="currentFolder._guiVersioning.selector=='staggered'" ng-class="{'has-error': folderEditor._guiVersioning.staggeredMaxAge.$invalid && folderEditor._guiVersioning.staggeredMaxAge.$dirty}">
|
||||
<p class="help-block"><span translate>Files are moved to date stamped versions in a .stversions directory when replaced or deleted by Syncthing.</span> <span translate>Versions are automatically deleted if they are older than the maximum age or exceed the number of files allowed in an interval.</span></p>
|
||||
<p translate class="help-block">The following intervals are used: for the first hour a version is kept every 30 seconds, for the first day a version is kept every hour, for the first 30 days a version is kept every day, until the maximum age a version is kept every week.</p>
|
||||
<label translate for="staggeredMaxAge">Maximum Age</label>
|
||||
<input name="staggeredMaxAge" id="staggeredMaxAge" class="form-control" type="number" ng-model="currentFolder.staggeredMaxAge" required="" aria-required="true" min="0" />
|
||||
<input name="staggeredMaxAge" id="staggeredMaxAge" class="form-control" type="number" ng-model="currentFolder._guiVersioning.staggeredMaxAge" required="" aria-required="true" min="0" />
|
||||
<p class="help-block">
|
||||
<span translate ng-if="folderEditor.staggeredMaxAge.$valid || folderEditor.staggeredMaxAge.$pristine">The maximum time to keep a version (in days, set to 0 to keep versions forever).</span>
|
||||
<span translate ng-if="folderEditor.staggeredMaxAge.$error.required && folderEditor.staggeredMaxAge.$dirty">The maximum age must be a number and cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor.staggeredMaxAge.$error.min && folderEditor.staggeredMaxAge.$dirty">A negative number of days doesn't make sense.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.staggeredMaxAge.$valid || folderEditor._guiVersioning.staggeredMaxAge.$pristine">The maximum time to keep a version (in days, set to 0 to keep versions forever).</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.staggeredMaxAge.$error.required && folderEditor._guiVersioning.staggeredMaxAge.$dirty">The maximum age must be a number and cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.staggeredMaxAge.$error.min && folderEditor._guiVersioning.staggeredMaxAge.$dirty">A negative number of days doesn't make sense.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-if="currentFolder.fileVersioningSelector == 'staggered'">
|
||||
<div class="form-group" ng-if="currentFolder._guiVersioning.selector == 'staggered'">
|
||||
<label translate for="staggeredVersionsPath">Versions Path</label>
|
||||
<input name="staggeredVersionsPath" id="staggeredVersionsPath" class="form-control" type="text" ng-model="currentFolder.staggeredVersionsPath" />
|
||||
<input name="staggeredVersionsPath" id="staggeredVersionsPath" class="form-control" type="text" ng-model="currentFolder._guiVersioning.staggeredVersionsPath" />
|
||||
<p translate class="help-block">Path where versions should be stored (leave empty for the default .stversions directory in the shared folder).</p>
|
||||
</div>
|
||||
<div class="form-group" ng-if="currentFolder.fileVersioningSelector=='external'" ng-class="{'has-error': folderEditor.externalCommand.$invalid && folderEditor.externalCommand.$dirty}">
|
||||
<div class="form-group" ng-if="currentFolder._guiVersioning.selector=='external'" ng-class="{'has-error': folderEditor.externalCommand.$invalid && folderEditor.externalCommand.$dirty}">
|
||||
<p translate class="help-block">An external command handles the versioning. It has to remove the file from the shared folder. If the path to the application contains spaces, it should be quoted.</p>
|
||||
<label translate for="externalCommand">Command</label>
|
||||
<input name="externalCommand" id="externalCommand" class="form-control" type="text" ng-model="currentFolder.externalCommand" required="" aria-required="true" />
|
||||
@@ -132,21 +134,21 @@
|
||||
<span translate ng-if="folderEditor.externalCommand.$error.required && folderEditor.externalCommand.$dirty">The path cannot be blank.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-if="currentFolder.fileVersioningSelector != 'none'" ng-class="{'has-error': folderEditor.versioningCleanupIntervalS.$invalid && folderEditor.versioningCleanupIntervalS.$dirty}">
|
||||
<div class="form-group" ng-if="currentFolder._guiVersioning.selector != 'none'" ng-class="{'has-error': folderEditor._guiVersioning.cleanupIntervalS.$invalid && folderEditor._guiVersioning.cleanupIntervalS.$dirty}">
|
||||
<label translate for="versioningCleanupIntervalS">Cleanup Interval</label>
|
||||
<div class="input-group">
|
||||
<input name="versioningCleanupIntervalS" id="versioningCleanupIntervalS" class="form-control text-right" type="number" ng-model="currentFolder.versioningCleanupIntervalS" required="" min="0" max="31536000" aria-required="true" />
|
||||
<input name="versioningCleanupIntervalS" id="versioningCleanupIntervalS" class="form-control text-right" type="number" ng-model="currentFolder._guiVersioning.cleanupIntervalS" required="" min="0" max="31536000" aria-required="true" />
|
||||
<div class="input-group-addon" translate>seconds</div>
|
||||
</div>
|
||||
<p class="help-block">
|
||||
<span translate ng-if="folderEditor.versioningCleanupIntervalS.$valid || folderEditor.versioningCleanupIntervalS.$pristine"class="help-block">The interval, in seconds, for running cleanup in the versions directory. Zero to disable periodic cleaning.</span>
|
||||
<span translate ng-if="folderEditor.versioningCleanupIntervalS.$error.required && folderEditor.versioningCleanupIntervalS.$dirty">The cleanup interval cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor.versioningCleanupIntervalS.$error.min && folderEditor.versioningCleanupIntervalS.$dirty">The interval must be a positive number of seconds.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.cleanupIntervalS.$valid || folderEditor._guiVersioning.cleanupIntervalS.$pristine"class="help-block">The interval, in seconds, for running cleanup in the versions directory. Zero to disable periodic cleaning.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.cleanupIntervalS.$error.required && folderEditor._guiVersioning.cleanupIntervalS.$dirty">The cleanup interval cannot be blank.</span>
|
||||
<span translate ng-if="folderEditor._guiVersioning.cleanupIntervalS.$error.min && folderEditor._guiVersioning.cleanupIntervalS.$dirty">The interval must be a positive number of seconds.</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="folder-ignores" class="tab-pane">
|
||||
<div ng-if="!editingDefaults" id="folder-ignores" class="tab-pane">
|
||||
<p translate>Enter ignore patterns, one per line.</p>
|
||||
<div ng-class="{'has-error': ignores.error != null}">
|
||||
<textarea class="form-control" rows="5" ng-model="ignores.text" ng-disabled="ignores.disabled"></textarea>
|
||||
@@ -271,7 +273,7 @@
|
||||
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
||||
<span class="fas fa-times"></span> <span translate>Close</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning pull-left btn-sm" data-toggle="modal" data-target="#remove-folder-confirmation" ng-if="editingExisting">
|
||||
<button type="button" class="btn btn-warning pull-left btn-sm" data-toggle="modal" data-target="#remove-folder-confirmation" ng-if="editingExisting && !editingDefaults">
|
||||
<span class="fas fa-minus-circle"></span> <span translate>Remove</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user