This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,12 @@ limitations under the License.
1818 margin : 10px 0 ;
1919}
2020
21- .mx_DevTools_RoomStateExplorer_button , .mx_DevTools_RoomStateExplorer_query {
21+ .mx_DevTools_ServersInRoomList_button {
22+ /* Set the cursor back to default as `.mx_Dialog button` sets it to pointer */
23+ cursor : default !important ;
24+ }
25+
26+ .mx_DevTools_RoomStateExplorer_button , .mx_DevTools_ServersInRoomList_button , .mx_DevTools_RoomStateExplorer_query {
2227 margin-bottom : 10px ;
2328 width : 100% ;
2429}
Original file line number Diff line number Diff line change @@ -551,11 +551,53 @@ class AccountDataExplorer extends DevtoolsComponent {
551551 }
552552}
553553
554+ class ServersInRoomList extends DevtoolsComponent {
555+ static getLabel ( ) { return _t ( 'View Servers in Room' ) ; }
556+
557+ static propTypes = {
558+ onBack : PropTypes . func . isRequired ,
559+ } ;
560+
561+ constructor ( props , context ) {
562+ super ( props , context ) ;
563+
564+ const room = MatrixClientPeg . get ( ) . getRoom ( this . context . roomId ) ;
565+ const servers = new Set ( ) ;
566+ room . currentState . getStateEvents ( "m.room.member" ) . forEach ( ev => servers . add ( ev . getSender ( ) . split ( ":" ) [ 1 ] ) ) ;
567+ this . servers = Array . from ( servers ) . map ( s =>
568+ < button key = { s } className = "mx_DevTools_ServersInRoomList_button" >
569+ { s }
570+ </ button > ) ;
571+
572+ this . state = {
573+ query : '' ,
574+ } ;
575+ }
576+
577+ onQuery = ( query ) => {
578+ this . setState ( { query } ) ;
579+ }
580+
581+ render ( ) {
582+ return < div >
583+ < div className = "mx_Dialog_content" >
584+ < FilteredList query = { this . state . query } onChange = { this . onQuery } >
585+ { this . servers }
586+ </ FilteredList >
587+ </ div >
588+ < div className = "mx_Dialog_buttons" >
589+ < button onClick = { this . props . onBack } > { _t ( 'Back' ) } </ button >
590+ </ div >
591+ </ div > ;
592+ }
593+ }
594+
554595const Entries = [
555596 SendCustomEvent ,
556597 RoomStateExplorer ,
557598 SendAccountData ,
558599 AccountDataExplorer ,
600+ ServersInRoomList ,
559601] ;
560602
561603export default class DevtoolsDialog extends React . Component {
Original file line number Diff line number Diff line change 11331133 "Filter results" : " Filter results" ,
11341134 "Explore Room State" : " Explore Room State" ,
11351135 "Explore Account Data" : " Explore Account Data" ,
1136+ "View Servers in Room" : " View Servers in Room" ,
11361137 "Toolbox" : " Toolbox" ,
11371138 "Developer Tools" : " Developer Tools" ,
11381139 "An error has occurred." : " An error has occurred." ,
You can’t perform that action at this time.
0 commit comments