gui: Show folder/device status on small screens (#8643)

gui: Show folder/device status on small screens

On larger screens, folder and device status is shown in a textual form
directly next to folder and device titles. However, on small screens,
only icons are currently shown, which may be ambiguous to new users, who
cannot possibly know what a specific icon means (see [1]). Thus, on
small screens only, display a new entry in folder/device info that
contains the same textual information that is shown in the title on
larger screens.

Signed-off-by: Tomasz Wilczyński <twilczynski@naver.com>
Co-authored-by: André Colomb <src@andre.colomb.de>
This commit is contained in:
tomasz1986
2023-12-10 15:14:10 +01:00
committed by GitHub
co-authored by André Colomb
parent a28de73031
commit d42fff1016
4 changed files with 136 additions and 49 deletions
@@ -1151,6 +1151,113 @@ angular.module('syncthing.core')
}
};
$scope.deviceStatusIcon = function(cfg) {
switch ($scope.deviceStatus(cfg)) {
case 'disconnected':
case 'disconnected-inactive':
return 'fa-power-off';
case 'insync':
return 'fa-check';
case 'paused':
return 'fa-pause';
case 'syncing':
return 'fa-sync';
case 'unused-disconnected':
case 'unused-insync':
case 'unused-paused':
return 'fa-unlink';
}
};
$scope.deviceStatusText = function(device) {
switch ($scope.deviceStatus(device)) {
case 'disconnected':
return $translate.instant('Disconnected');
case 'disconnected-inactive':
return $translate.instant('Disconnected (Inactive)');
case 'insync':
return $translate.instant('Up to Date');
case 'paused':
return $translate.instant('Paused');
case 'syncing':
return $translate.instant('Syncing');
case 'unused-disconnected':
return $translate.instant('Disconnected (Unused)');
case 'unused-insync':
return $translate.instant('Connected (Unused)');
case 'unused-paused':
return $translate.instant('Paused (Unused)');
}
};
$scope.folderStatusIcon = function(cfg) {
switch ($scope.folderStatus(cfg)) {
case 'clean-waiting':
case 'scan-waiting':
case 'sync-preparing':
case 'sync-waiting':
return 'fa-hourglass-half';
case 'cleaning':
return 'fa-recycle';
case 'faileditems':
case 'localunencrypted':
case 'outofsync':
return 'fa-exclamation-circle';
case 'idle':
case 'localadditions':
return 'fa-check';
case 'paused':
return 'fa-pause';
case 'scanning':
return 'fa-search';
case 'stopped':
return 'fa-stop';
case 'syncing':
return 'fa-sync';
case 'unknown':
return 'fa-question-circle';
case 'unshared':
return 'fa-unlink';
}
};
$scope.folderStatusText = function(folder) {
switch ($scope.folderStatus(folder)) {
case 'clean-waiting':
return $translate.instant('Waiting to Clean');
case 'cleaning':
return $translate.instant('Cleaning Versions');
case 'faileditems':
return $translate.instant('Failed Items');
case 'idle':
return $translate.instant('Up to Date');
case 'localadditions':
return $translate.instant('Local Additions');
case 'localunencrypted':
return $translate.instant('Unexpected Items');
case 'outofsync':
return $translate.instant('Out of Sync');
case 'paused':
return $translate.instant('Paused');
case 'scan-waiting':
return $translate.instant('Waiting to Scan');
case 'scanning':
return $translate.instant('Scanning');
case 'stopped':
return $translate.instant('Stopped');
case 'sync-preparing':
return $translate.instant('Preparing to Sync');
case 'sync-waiting':
return $translate.instant('Waiting to Sync');
case 'syncing':
return $translate.instant('Syncing');
case 'unknown':
return $translate.instant('Unknown');
case 'unshared':
return $translate.instant('Unshared');
}
};
$scope.deviceClass = function (deviceCfg) {
if (typeof $scope.connections[deviceCfg.deviceID] === 'undefined') {
return 'info';