diff --git a/gui/black/assets/css/theme.css b/gui/black/assets/css/theme.css index 622a22a58..1e280a952 100644 --- a/gui/black/assets/css/theme.css +++ b/gui/black/assets/css/theme.css @@ -273,3 +273,8 @@ code.ng-binding{ .fancytree-focused { background-color: #222; } + +/* Remote Devices 'connection type'-icon color set to #aaa */ +.reception { + filter: invert(77%) sepia(0%) saturate(724%) hue-rotate(146deg) brightness(91%) contrast(85%); +} diff --git a/gui/dark/assets/css/theme.css b/gui/dark/assets/css/theme.css index f554bb8a8..26ab0f898 100644 --- a/gui/dark/assets/css/theme.css +++ b/gui/dark/assets/css/theme.css @@ -285,3 +285,8 @@ code.ng-binding{ .fancytree-focused { background-color: #424242; } + +/* Remote Devices 'connection type'-icon color set to #aaa */ +.reception { + filter: invert(77%) sepia(0%) saturate(724%) hue-rotate(146deg) brightness(91%) contrast(85%); +} \ No newline at end of file diff --git a/gui/default/assets/css/overrides.css b/gui/default/assets/css/overrides.css index 7033d8e36..5186ec5c2 100644 --- a/gui/default/assets/css/overrides.css +++ b/gui/default/assets/css/overrides.css @@ -144,6 +144,38 @@ table.table-auto td { max-width: 0px; } +/* Remote Devices connection-quality indicator */ +.reception-0 { + background: url('../../vendor/bootstrap/fonts/reception-0.svg') no-repeat; +} + +.reception-1 { + background: url('../../vendor/bootstrap/fonts/reception-1.svg') no-repeat; +} + +.reception-2 { + background: url('../../vendor/bootstrap/fonts/reception-2.svg') no-repeat; +} + +.reception-3 { + background: url('../../vendor/bootstrap/fonts/reception-3.svg') no-repeat; +} + +.reception-4 { + background: url('../../vendor/bootstrap/fonts/reception-4.svg') no-repeat; +} + +.reception { + width: 1em; + height: 1em; + display: inline-block; + vertical-align: -20%; +} + +.remote-devices-panel { + display: inline-block; +} + /* Wrap long file paths to prevent text overflow. See issue #6268. */ .file-path { word-break: break-all; diff --git a/gui/default/index.html b/gui/default/index.html index 664c8f37f..d197b0e09 100644 --- a/gui/default/index.html +++ b/gui/default/index.html @@ -24,6 +24,7 @@ + @@ -737,16 +738,25 @@

- - - - - ({{completion[deviceCfg.deviceID]._total | percent}}, {{completion[deviceCfg.deviceID]._needBytes | binary}}B) + + + + + + ({{completion[deviceCfg.deviceID]._total | percent}}, {{completion[deviceCfg.deviceID]._needBytes | binary}}B) + + + + + + + + + + + + - - - -
{{deviceName(deviceCfg)}}

@@ -823,9 +833,13 @@ - -  Connection Type - {{connections[deviceCfg.deviceID].type}} + +  Connection Type + + + {{rdConnTypeString(rdConnType(deviceCfg.deviceID))}} + +  Allowed Networks diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index de5d32659..49d9d446e 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -1192,6 +1192,61 @@ angular.module('syncthing.core') return '?'; }; + $scope.rdConnType = function(deviceID) { + var conn = $scope.connections[deviceID]; + if(!conn) + return "-1"; + + if (conn.type.indexOf('relay') === 0) + return "relay"; + + if (conn.type.indexOf('quic') === 0) + return "quic"; + + if(conn.type.indexOf('tcp') === 0) + return "tcp"+rdAddrType(conn.address); + + return "disconnected"; + } + + function rdAddrType(address) { + var re = /(^(?:127\.|0?10\.|172\.0?1[6-9]\.|172\.0?2[0-9]\.|172\.0?3[01]\.|192\.168\.|169\.254\.|::1|[fF][cCdD][0-9a-fA-F]{2}:|[fF][eE][89aAbB][0-9a-fA-F]:))/ + if(re.test(address)) + return "lan"; + + return "wan"; + } + + $scope.rdConnTypeString = function(type) { + switch (type) { + case "relay": + return $translate.instant('Relay'); + case "quic": + return $translate.instant('QUIC'); + case "tcpwan": + return $translate.instant('TCP WAN'); + case "tcplan": + return $translate.instant('TCP LAN'); + default: + return $translate.instant('Disconnected'); + } + } + + $scope.rdConnDetails = function(type) { + switch (type) { + case "relay": + return $translate.instant('Connections via relays might be rate limited by the relay'); + case "quic": + return $translate.instant('QUIC connections are in most cases considered suboptimal'); + case "tcpwan": + return $translate.instant('Using a direct TCP connection over WAN'); + case "tcplan": + return $translate.instant('Using a direct TCP connection over LAN'); + default: + return $translate.instant('Unknown'); + } + } + $scope.hasRemoteGUIAddress = function (deviceCfg) { if (!deviceCfg.remoteGUIPort) return false; diff --git a/gui/default/vendor/bootstrap/fonts/reception-0.svg b/gui/default/vendor/bootstrap/fonts/reception-0.svg new file mode 100644 index 000000000..885bf3bb3 Binary files /dev/null and b/gui/default/vendor/bootstrap/fonts/reception-0.svg differ diff --git a/gui/default/vendor/bootstrap/fonts/reception-1.svg b/gui/default/vendor/bootstrap/fonts/reception-1.svg new file mode 100644 index 000000000..3deafb622 Binary files /dev/null and b/gui/default/vendor/bootstrap/fonts/reception-1.svg differ diff --git a/gui/default/vendor/bootstrap/fonts/reception-2.svg b/gui/default/vendor/bootstrap/fonts/reception-2.svg new file mode 100644 index 000000000..7dca57aca Binary files /dev/null and b/gui/default/vendor/bootstrap/fonts/reception-2.svg differ diff --git a/gui/default/vendor/bootstrap/fonts/reception-3.svg b/gui/default/vendor/bootstrap/fonts/reception-3.svg new file mode 100644 index 000000000..b30d5fb79 Binary files /dev/null and b/gui/default/vendor/bootstrap/fonts/reception-3.svg differ diff --git a/gui/default/vendor/bootstrap/fonts/reception-4.svg b/gui/default/vendor/bootstrap/fonts/reception-4.svg new file mode 100644 index 000000000..611bdf1b9 Binary files /dev/null and b/gui/default/vendor/bootstrap/fonts/reception-4.svg differ diff --git a/gui/light/assets/css/theme.css b/gui/light/assets/css/theme.css index 7e7212d32..8a6183d46 100644 --- a/gui/light/assets/css/theme.css +++ b/gui/light/assets/css/theme.css @@ -36,3 +36,8 @@ .fancytree-focused { background-color: #eeeeee; } + +/* Remote Devices 'connection type'-icon color set to #333 */ +.reception { + filter: invert(12%) sepia(11%) saturate(20%) hue-rotate(318deg) brightness(100%) contrast(80%); +}