@@ -226,8 +226,10 @@ export function ConnectionsSettings({ view }: { readonly view: "environments" |
226226 const [ createdPairingCredentials , setCreatedPairingCredentials ] = useState <
227227 ReadonlyMap < string , string >
228228 > ( ( ) => new Map ( ) ) ;
229+ const [ newestPairingLinkId , setNewestPairingLinkId ] = useState < string | null > ( null ) ;
229230 const handlePairingLinkCreated = ( created : AuthPairingCredentialResult ) => {
230231 setCreatedPairingCredentials ( ( current ) => new Map ( current ) . set ( created . id , created . credential ) ) ;
232+ setNewestPairingLinkId ( created . id ) ;
231233 } ;
232234 const [ revokingDesktopPairingLinkId , setRevokingDesktopPairingLinkId ] = useState < string | null > (
233235 null ,
@@ -928,27 +930,37 @@ export function ConnectionsSettings({ view }: { readonly view: "environments" |
928930 managed = { tailscaleHttpsEndpoint ?. status === "available" ? undefined : remoteClientsDenial }
929931 />
930932 ) ;
933+ const newestPairingLink = visibleDesktopPairingLinks . find (
934+ ( pairingLink ) => pairingLink . id === newestPairingLinkId ,
935+ ) ;
936+ const renderPairingClientsList = (
937+ pairingLinks : typeof visibleDesktopPairingLinks ,
938+ clientSessions : typeof desktopClientSessions ,
939+ ) => (
940+ < PairingClientsList
941+ endpointUrl = { desktopServerExposureState ?. endpointUrl }
942+ endpoints = { visibleDesktopAdvertisedEndpoints }
943+ defaultEndpointKey = { defaultDesktopAdvertisedEndpointKey }
944+ isLoading = { isLoadingDesktopAccessManagement }
945+ pairingLinks = { pairingLinks }
946+ createdPairingCredentials = { createdPairingCredentials }
947+ sharedPairingLinkId = { newestPairingLinkId }
948+ clientSessions = { clientSessions }
949+ revokingPairingLinkId = { revokingDesktopPairingLinkId }
950+ revokingClientSessionId = { revokingDesktopClientSessionId }
951+ onRevokePairingLink = { handleRevokeDesktopPairingLink }
952+ onRevokeClientSession = { handleRevokeDesktopClientSession }
953+ canRevoke = { canWriteAccess }
954+ />
955+ ) ;
931956 const renderAuthorizedClients = ( ) => (
932957 < >
933958 { desktopAccessManagementError ? (
934959 < div className = { ITEM_ROW_CLASSNAME } >
935960 < p className = "text-xs text-destructive" > { desktopAccessManagementError } </ p >
936961 </ div >
937962 ) : null }
938- < PairingClientsList
939- endpointUrl = { desktopServerExposureState ?. endpointUrl }
940- endpoints = { visibleDesktopAdvertisedEndpoints }
941- defaultEndpointKey = { defaultDesktopAdvertisedEndpointKey }
942- isLoading = { isLoadingDesktopAccessManagement }
943- pairingLinks = { visibleDesktopPairingLinks }
944- createdPairingCredentials = { createdPairingCredentials }
945- clientSessions = { desktopClientSessions }
946- revokingPairingLinkId = { revokingDesktopPairingLinkId }
947- revokingClientSessionId = { revokingDesktopClientSessionId }
948- onRevokePairingLink = { handleRevokeDesktopPairingLink }
949- onRevokeClientSession = { handleRevokeDesktopClientSession }
950- canRevoke = { canWriteAccess }
951- />
963+ { renderPairingClientsList ( visibleDesktopPairingLinks , desktopClientSessions ) }
952964 </ >
953965 ) ;
954966 const renderNetworkAccessRow = ( ) => (
@@ -1153,6 +1165,11 @@ export function ConnectionsSettings({ view }: { readonly view: "environments" |
11531165 < FoldedSettingsSection
11541166 id = "authorized-clients"
11551167 title = "Authorized clients"
1168+ collapsedContent = {
1169+ canReadAccess && newestPairingLink
1170+ ? renderPairingClientsList ( [ newestPairingLink ] , [ ] )
1171+ : undefined
1172+ }
11561173 summary = { summarizeAuthorizedClients (
11571174 desktopClientSessions ,
11581175 visibleDesktopPairingLinks ,
0 commit comments