Repository: syncthing/syncthing
File: gui/default/syncthing/core/syncthingController.js (JavaScript)

Code before:
            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('Unkown');
            }
        }

        $scope.hasRemoteGUIAddress = function (deviceCfg) {
            if (!deviceCfg.remoteGUIPort)
                return false;
            var conn = $scope.connections[deviceCfg.deviceID];
            return conn && conn.connected && conn.address && conn.type.indexOf('Relay') == -1;
        };

        $scope.remoteGUIAddress = function (deviceCfg) {
            // Assume hasRemoteGUIAddress is true or we would not be here
            var conn = $scope.connections[deviceCfg.deviceID];
            // Use regex to filter out scope ID from IPv6 addresses.
            return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort).replace('%.*?\]:', ']:');
        };

        function replaceAddressPort(address, newPort) {
            for (var index = address.length - 1; index >= 0; index--) {
                if (address[index] === ":") {
                    return address.substr(0, index) + ":" + newPort.toString();
                }
            }
            return address;
        }

Review comment (suggestion):
```suggestion
                    return $translate.instant('Unknown');
```

Code after:
            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;
            var conn = $scope.connections[deviceCfg.deviceID];
            return conn && conn.connected && conn.address && conn.type.indexOf('Relay') == -1;
        };

        $scope.remoteGUIAddress = function (deviceCfg) {
            // Assume hasRemoteGUIAddress is true or we would not be here
            var conn = $scope.connections[deviceCfg.deviceID];
            // Use regex to filter out scope ID from IPv6 addresses.
            return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort).replace('%.*?\]:', ']:');
        };

        function replaceAddressPort(address, newPort) {
            for (var index = address.length - 1; index >= 0; index--) {
                if (address[index] === ":") {
                    return address.substr(0, index) + ":" + newPort.toString();
                }
            }
            return address;
        }