From 2d82dad806e3d0c40151ba44712df80202848694 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 6 Sep 2023 22:48:06 +0000 Subject: [PATCH] Restore the connections tab. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4452 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb/tf-tab-connections.js | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/apps/ssb/tf-tab-connections.js b/apps/ssb/tf-tab-connections.js index a610a101..b51b4d7f 100644 --- a/apps/ssb/tf-tab-connections.js +++ b/apps/ssb/tf-tab-connections.js @@ -42,11 +42,8 @@ class TfTabConnectionsElement extends LitElement { let self = this; let peers = this.broadcasts.filter(x => x.tunnel?.id == connection); if (peers.length) { - return html` - - `; + let connections = this.connections.map(x => x.id); + return html`${peers.filter(x => connections.indexOf(x.pubkey) == -1).map(x => html`${self.render_room_peer(x)}`)}`; } } @@ -59,7 +56,7 @@ class TfTabConnectionsElement extends LitElement { return html`
  • self._tunnel(connection.tunnel.id, connection.pubkey)} value="Connect"> - + 📡
  • `; } @@ -79,6 +76,18 @@ class TfTabConnectionsElement extends LitElement { this.stored_connections = (await tfrpc.rpc.getStoredConnections()) || []; } + render_connection(connection) { + return html` + tfrpc.rpc.closeConnection(connection.id)} value="Close"> + + ${connection.tunnel !== undefined ? '🚇' : html`(${connection.host}:${connection.port})`} + + `; + } + render() { let self = this; return html` @@ -93,12 +102,8 @@ class TfTabConnectionsElement extends LitElement {

    Connections

    Stored Connections (WIP)