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

Code before:
                return 'pause';
            }

            return 'default';
        };

        $scope.deviceAddr = function (deviceCfg) {
            var conn = $scope.connections[deviceCfg.deviceID];
            if (conn && conn.connected) {
                return conn.address;
            }
            return '?';
        };

        $scope.rdConnType = function(deviceID){
            var conn = $scope.connections[deviceID];
            if(!conn)
                return -1;
                
            if (conn.type.startsWith('relay'))
                return 1;
            
            if (conn.type.startsWith('quic'))
                return 2;
            
            if(conn.type.startsWith('tcp'))
                return 3+rdAddrType(conn.address);

            return -1;
        }

        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 1;
        
            return 0;
        }

        $scope.rdConnTypeString = function(type){
            switch (type) {
                case 1:
                    return $translate.instant('Relay');
                case 2:
                    return $translate.instant('QUIC');
                case 3:
                    return $translate.instant('TCP WAN');
                case 4:
                    return $translate.instant('TCP LAN');
                default:
                    return $translate.instant('Disconnected');

Review comment (suggestion):
```suggestion
            if(conn.type.indexOf('tcp') === 0)
```

Code after:
                return 'pause';
            }

            return 'default';
        };

        $scope.deviceAddr = function (deviceCfg) {
            var conn = $scope.connections[deviceCfg.deviceID];
            if (conn && conn.connected) {
                return conn.address;
            }
            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');