@@ -75,6 +75,22 @@ const protocolsCellRenderer = (t) => ({ rowData }) => {
7575 )
7676}
7777
78+ const agentVersionCellRenderer = ( t ) => ( { rowData } ) => {
79+ const ref = React . createRef ( )
80+ const { agentVersion } = rowData
81+ if ( ! agentVersion ) return ( < span className = 'dib o-40 no-select' > -</ span > )
82+ return (
83+ < CopyToClipboard text = { agentVersion } onCopy = { ( ) => copyFeedback ( ref , t ) } >
84+ < span
85+ ref = { ref }
86+ className = 'copyable'
87+ title = { agentVersion } >
88+ { agentVersion }
89+ </ span >
90+ </ CopyToClipboard >
91+ )
92+ }
93+
7894const connectionCellRenderer = ( t ) => ( { rowData } ) => {
7995 const ref = React . createRef ( )
8096 const { address, direction, peerId } = rowData
@@ -140,7 +156,7 @@ export const PeersTable = ({ className, t, peerLocationsForSwarm, selectedPeers
140156 const filteredPeerList = useMemo ( ( ) => {
141157 const filterLower = filter . toLowerCase ( )
142158 if ( filterLower === '' ) return awaitedPeerLocationsForSwarm
143- return awaitedPeerLocationsForSwarm . filter ( ( { location, latency, peerId, connection, protocols } ) => {
159+ return awaitedPeerLocationsForSwarm . filter ( ( { location, latency, peerId, connection, protocols, agentVersion } ) => {
144160 if ( location != null && location . toLowerCase ( ) . includes ( filterLower ) ) {
145161 return true
146162 }
@@ -150,13 +166,15 @@ export const PeersTable = ({ className, t, peerLocationsForSwarm, selectedPeers
150166 if ( peerId != null && peerId . toString ( ) . includes ( filter ) ) {
151167 return true
152168 }
153- console . log ( 'connection: ' , connection )
154169 if ( connection != null && connection . toLowerCase ( ) . includes ( filterLower ) ) {
155170 return true
156171 }
157172 if ( protocols != null && protocols . toLowerCase ( ) . includes ( filterLower ) ) {
158173 return true
159174 }
175+ if ( agentVersion != null && agentVersion . toLowerCase ( ) . includes ( filterLower ) ) {
176+ return true
177+ }
160178
161179 return false
162180 } )
@@ -186,11 +204,12 @@ export const PeersTable = ({ className, t, peerLocationsForSwarm, selectedPeers
186204 sort = { sort }
187205 sortBy = { sortBy }
188206 sortDirection = { sortDirection } >
189- < Column label = { t ( 'app:terms.location' ) } cellRenderer = { locationCellRenderer ( t ) } dataKey = 'location' width = { 450 } className = 'f6 charcoal truncate pl2' />
190- < Column label = { t ( 'app:terms.latency' ) } cellRenderer = { latencyCellRenderer } dataKey = 'latency' width = { 200 } className = 'f6 charcoal pl2' />
191- < Column label = { t ( 'app:terms.peerId' ) } cellRenderer = { peerIdCellRenderer ( t ) } dataKey = 'peerId' width = { 250 } className = 'charcoal monospace truncate f6 pl2' />
192- < Column label = { t ( 'app:terms.connection' ) } cellRenderer = { connectionCellRenderer ( t ) } dataKey = 'connection' width = { 250 } className = 'f6 charcoal truncate pl2' />
193- < Column label = { t ( 'protocols' ) } cellRenderer = { protocolsCellRenderer ( t ) } dataKey = 'protocols' width = { 520 } className = 'charcoal monospace truncate f7 pl2' />
207+ < Column label = { t ( 'app:terms.location' ) } cellRenderer = { locationCellRenderer ( t ) } dataKey = 'location' width = { 350 } className = 'f6 charcoal truncate pl2' />
208+ < Column label = { t ( 'app:terms.latency' ) } cellRenderer = { latencyCellRenderer } dataKey = 'latency' width = { 100 } className = 'f6 charcoal pl2' />
209+ < Column label = { t ( 'app:terms.peerId' ) } cellRenderer = { peerIdCellRenderer ( t ) } dataKey = 'peerId' width = { 200 } className = 'charcoal monospace truncate f6 pl2' />
210+ < Column label = { t ( 'app:terms.connection' ) } cellRenderer = { connectionCellRenderer ( t ) } dataKey = 'connection' width = { 200 } className = 'f6 charcoal truncate pl2' />
211+ < Column label = { t ( 'agentVersion' ) } cellRenderer = { agentVersionCellRenderer ( t ) } dataKey = 'agentVersion' width = { 250 } className = 'charcoal monospace truncate f7 pl2' />
212+ < Column label = { t ( 'protocols' ) } cellRenderer = { protocolsCellRenderer ( t ) } dataKey = 'protocols' width = { 420 } className = 'charcoal monospace truncate f7 pl2' />
194213 </ Table >
195214 </ >
196215 ) }
0 commit comments