feat: show wss URL

This commit is contained in:
Vlad Stan 2023-02-24 15:10:58 +02:00
parent 5e313c0282
commit 63be2b5b2d
3 changed files with 29 additions and 6 deletions

View file

@ -68,6 +68,26 @@
</div> </div>
<div class="col-3 col-sm-1"></div> <div class="col-3 col-sm-1"></div>
</div> </div>
<div class="row items-center no-wrap q-mb-md">
<div class="col-3 q-pr-lg">Web Socket Link:</div>
<div class="col-6 col-sm-8 q-pr-lg">
<q-input
filled
dense
v-model.trim="wssLink"
type="text"
readonly
></q-input>
</div>
<div class="col-3 col-sm-1">
<q-btn
outline
color="grey"
@click="copyText(disclaimerDialog.location.href)"
>Copy</q-btn
>
</div>
</div>
</div> </div>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="payment"> <q-tab-panel name="payment">

View file

@ -92,6 +92,13 @@ async function relayDetails(path) {
{value: 'block', label: 'Block New Events'}, {value: 'block', label: 'Block New Events'},
{value: 'prune', label: 'Prune Old Events'} {value: 'prune', label: 'Prune Old Events'}
] ]
},
wssLink: function () {
this.relay.config.domain =
this.relay.config.domain || window.location.hostname
return (
'wss://' + this.relay.config.domain + '/nostrrelay/' + this.relay.id
)
} }
}, },
@ -138,7 +145,7 @@ async function relayDetails(path) {
updateRelay: async function () { updateRelay: async function () {
try { try {
const {data} = await LNbits.api.request( const {data} = await LNbits.api.request(
'PUT', 'PATCH',
'/nostrrelay/api/v1/relay/' + this.relayId, '/nostrrelay/api/v1/relay/' + this.relayId,
this.adminkey, this.adminkey,
this.relay this.relay

View file

@ -140,11 +140,7 @@ const relays = async () => {
'PUT', 'PUT',
'/nostrrelay/api/v1/relay/' + relay.id, '/nostrrelay/api/v1/relay/' + relay.id,
this.g.user.wallets[0].adminkey, this.g.user.wallets[0].adminkey,
{ {}
active: relay.active,
id: relay.id,
name: relay.name
}
) )
} catch (error) { } catch (error) {
LNbits.utils.notifyApiError(error) LNbits.utils.notifyApiError(error)