forked from cory/tildefriends
Eh?
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4037 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
1e84b74ced
commit
20ebdea9d1
@ -1 +1 @@
|
||||
{"type":"tildefriends-app","files":{"app.js":"&jLRr14wP54BEkzBMIf1vCdeylqYExD8+jnHwgsqV9a4=.sha256","lit-all.min.js":"&N4A12AsifdQgwdpII0SFtG513BfoLpmPjdJ9VTDftpg=.sha256","index.html":"&TxhFekB9ov7tf/fmkAg7x5797i27oLidhgxEfDKC0T0=.sha256","script.js":"&G8puK9Q4MngHy3D4ppcKyT49WKbHD2OCeUcAw2ghTDE=.sha256","lit-all.min.js.map":"&oFY9wO4MnujgfGNGv4VggHc5V5JwX4C8csqKZ6KJYbE=.sha256","tf-id-picker.js":"&9BDffV4HY9FqhL7XI4it+UQJB4cYwbDNsY3S1cxy2vw=.sha256","tf-app.js":"&fEqRRoyD6C7oNGcveWy02XRdymmTgAVwFHvkTC1xOjU=.sha256","tf-message.js":"&GPimOaVkY0hmNYxgQAwdMX+5FoGAvg500yWie9+4SVY=.sha256","tf-user.js":"&bXTedgBudTQLXEBPY9R8OLfQ/ZLpo8YRU9Oq/wuGG3Y=.sha256","tf-utils.js":"&6RQUuxB3PkOhYEJr9+89Ptx7uijczjn0r035yCcQOQQ=.sha256","commonmark.min.js":"&bfBaMLU19d1p/vPBF9hlARqDX002KXG/UOfxOahZhe4=.sha256","tf-compose.js":"&ZGWHQZPTUl4QU5++WkGwGbyj+hxhQrTg9nLmZCrl/1g=.sha256","emojis.json":"&h3P4pez+AI4aYdsN0dJ3pbUEFR0276t9AM20caj/W/s=.sha256","emojis.js":"&pqYLDE/13PyEt2ceeFqvnwZ8NqWfPfpDBt4vP8SeHbs=.sha256","tf-styles.js":"&Zw90HptAvGwX/vBnEhRVfNrYjMSssFnnKpp8bzwXQH0=.sha256","tf-profile.js":"&vRKjsnYvOiHCQahzEfznCvP5YDwUPtltlpWf+pxwZ1Y=.sha256","commonmark-linkify.js":"&X+hNNkmSRvKY86khyAun+cXksquXbMakZdINbGbx30g=.sha256","tf-tab-search.js":"&ESt2vMG19sH5j6ungKua/ZuvIGslyuWyb3juXdOCecg=.sha256","tf-tab-news.js":"&SSHoFxBG2DiKUbfMNxiBjxqtAccQDSAEUTSN/IN/MlY=.sha256","tf-tab-connections.js":"&PjreVhTR/vxlGHVKQbY0P9BuD6udtPMHDUv9HPCHuKw=.sha256","tf-news.js":"&/Ij0SaBTohV2myuA1gQAPlgmyq/AmmvYIhSCm3wfmow=.sha256","tribute.css":"&9FogMzZHKXCfGb7mlh7z+/wiNZzBsOB/tKoh6MfYJno=.sha256","tribute.esm.js":"&P1wKqCfYULpR/ahSB98JP8xaxfikuZwwtT6I/SAo7/Y=.sha256","commonmark-hashtag.js":"&H+V1OLA9GDdzycKclz276zAtSZLpT3rlNVa4+qQmp4o=.sha256"}}
|
||||
{"type":"tildefriends-app","files":{"app.js":"&thMY1jFZO0Tt+d2o4vD6Lb/eMGH1+25styf00AukQmI=.sha256","lit-all.min.js":"&N4A12AsifdQgwdpII0SFtG513BfoLpmPjdJ9VTDftpg=.sha256","index.html":"&TxhFekB9ov7tf/fmkAg7x5797i27oLidhgxEfDKC0T0=.sha256","script.js":"&G8puK9Q4MngHy3D4ppcKyT49WKbHD2OCeUcAw2ghTDE=.sha256","lit-all.min.js.map":"&oFY9wO4MnujgfGNGv4VggHc5V5JwX4C8csqKZ6KJYbE=.sha256","tf-id-picker.js":"&9BDffV4HY9FqhL7XI4it+UQJB4cYwbDNsY3S1cxy2vw=.sha256","tf-app.js":"&fEqRRoyD6C7oNGcveWy02XRdymmTgAVwFHvkTC1xOjU=.sha256","tf-message.js":"&GPimOaVkY0hmNYxgQAwdMX+5FoGAvg500yWie9+4SVY=.sha256","tf-user.js":"&bXTedgBudTQLXEBPY9R8OLfQ/ZLpo8YRU9Oq/wuGG3Y=.sha256","tf-utils.js":"&6RQUuxB3PkOhYEJr9+89Ptx7uijczjn0r035yCcQOQQ=.sha256","commonmark.min.js":"&bfBaMLU19d1p/vPBF9hlARqDX002KXG/UOfxOahZhe4=.sha256","tf-compose.js":"&ZGWHQZPTUl4QU5++WkGwGbyj+hxhQrTg9nLmZCrl/1g=.sha256","emojis.json":"&h3P4pez+AI4aYdsN0dJ3pbUEFR0276t9AM20caj/W/s=.sha256","emojis.js":"&pqYLDE/13PyEt2ceeFqvnwZ8NqWfPfpDBt4vP8SeHbs=.sha256","tf-styles.js":"&Zw90HptAvGwX/vBnEhRVfNrYjMSssFnnKpp8bzwXQH0=.sha256","tf-profile.js":"&vRKjsnYvOiHCQahzEfznCvP5YDwUPtltlpWf+pxwZ1Y=.sha256","commonmark-linkify.js":"&X+hNNkmSRvKY86khyAun+cXksquXbMakZdINbGbx30g=.sha256","tf-tab-search.js":"&ESt2vMG19sH5j6ungKua/ZuvIGslyuWyb3juXdOCecg=.sha256","tf-tab-news.js":"&SSHoFxBG2DiKUbfMNxiBjxqtAccQDSAEUTSN/IN/MlY=.sha256","tf-tab-connections.js":"&b1bFPkjIo+1iSpD1V63UWqI8+4tMOY6UYozMYEVXUKI=.sha256","tf-news.js":"&/Ij0SaBTohV2myuA1gQAPlgmyq/AmmvYIhSCm3wfmow=.sha256","tribute.css":"&9FogMzZHKXCfGb7mlh7z+/wiNZzBsOB/tKoh6MfYJno=.sha256","tribute.esm.js":"&P1wKqCfYULpR/ahSB98JP8xaxfikuZwwtT6I/SAo7/Y=.sha256","commonmark-hashtag.js":"&H+V1OLA9GDdzycKclz276zAtSZLpT3rlNVa4+qQmp4o=.sha256"}}
|
@ -30,6 +30,14 @@ tfrpc.register(async function getBroadcasts() {
|
||||
tfrpc.register(async function getConnections() {
|
||||
return ssb.connections();
|
||||
});
|
||||
tfrpc.register(async function connectionSendJson(id, message) {
|
||||
return ssb.connectionSendJson(id, message);
|
||||
});
|
||||
tfrpc.register(async function createTunnel(portal, request_number, target) {
|
||||
print('createTunnel', portal, request_number, target);
|
||||
let t = ssb.createTunnel(portal, request_number, target);
|
||||
return t;
|
||||
});
|
||||
tfrpc.register(async function connect(token) {
|
||||
await ssb.connect(token);
|
||||
});
|
||||
|
@ -52,12 +52,28 @@ class TfTabConnectionsElement extends LitElement {
|
||||
if (peers.length) {
|
||||
return html`
|
||||
<ul>
|
||||
${peers.map(x => html`${self.render_broadcast(x)}`)}
|
||||
${peers.map(x => html`${self.render_room_peer(x)}`)}
|
||||
</ul>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
async _tunnel(portal, target) {
|
||||
let request_number = await tfrpc.rpc.connectionSendJson(portal, {name: ['tunnel', 'connect'], args: [{portal: portal, target: target}], type: 'duplex'});
|
||||
return tfrpc.rpc.createTunnel(portal, request_number, target);
|
||||
}
|
||||
|
||||
render_room_peer(connection) {
|
||||
let self = this;
|
||||
return html`
|
||||
<li>
|
||||
<input type="button" @click=${() => self._tunnel(connection.tunnel.id, connection.pubkey)} value="Connect"></input>
|
||||
<tf-user id=${connection.pubkey} .users=${this.users}></tf-user>
|
||||
(room peer)
|
||||
</li>
|
||||
`;
|
||||
}
|
||||
|
||||
render_broadcast(connection) {
|
||||
return html`
|
||||
<li>
|
||||
|
Loading…
Reference in New Issue
Block a user