gui: Show encryption status for devices sharing folder (ref #8808) (#9355)

This re-implements the stalled enhancement from #8808. Thanks @Craeckie
for the idea and first implementation draft!

If a folder is shared to a device with encryption, add a lock icon in
front of the device name under "Shared With" in the folder details
panel. Be careful not to add whitespace caused by line wraps in HTML
source code, which would defeat the purpose of keeping the icon glued to
the name by a non-breaking space.

Apply the same lock icon for the list of folders shared with a device.
This commit is contained in:
André Colomb
2024-03-03 21:09:57 +01:00
committed by GitHub
parent 13a6d43f0b
commit 5fdab1bf11
2 changed files with 17 additions and 2 deletions
@@ -2662,6 +2662,15 @@ angular.module('syncthing.core')
+ '&device=' + encodeURIComponent(deviceID));
};
$scope.folderIsSharedEncrypted = function (folderID, deviceID) {
var folderCfg = $scope.folders[folderID];
if (!folderCfg || folderCfg.type === 'receiveencrypted') return false;
return folderCfg.devices.some(function (device) {
return device.deviceID === deviceID && device.encryptionPassword !== '';
});
};
$scope.folderHasUnacceptedDevices = function (folderCfg) {
for (var deviceID in $scope.completion) {
if (deviceID in $scope.devices