Skip to content

Commit

Permalink
fix: websocket url
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Nov 4, 2024
1 parent a761a1c commit 246d2b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 34 deletions.
4 changes: 3 additions & 1 deletion static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ window.app = Vue.createApp({
const bitcoinswitch = _.findWhere(this.bitcoinswitches, {
id: bitcoinswitchId
})
this.wslocation =
'wss://' + window.location.host + '/api/v1/ws/' + bitcoinswitchId
this.settingsDialog.data = _.clone(bitcoinswitch)
this.settingsDialog.show = true
},
Expand Down Expand Up @@ -261,7 +263,7 @@ window.app = Vue.createApp({
this.location = [window.location.protocol, '//', window.location.host].join(
''
)
this.wslocation = ['ws://', window.location.host].join('')
this.wslocation = ['wss://', window.location.host].join('')
LNbits.api
.request('GET', '/api/v1/currencies')
.then(response => {
Expand Down
46 changes: 13 additions & 33 deletions templates/bitcoinswitch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,39 +171,19 @@ <h6 class="text-subtitle1 q-my-none">
deviceition="top"
@hide="closeFormDialog"
>
<q-card
style="width: 700px; max-width: 80vw"
class="q-pa-lg q-pt-xl lnbits__dialog-card"
>
<div class="text-h6">LNURLDevice device string</div>
<center>
<q-btn
v-if="settingsDialog.data.device == 'switch'"
dense
outline
unelevated
color="primary"
size="md"
@click="copyText(wslocation + '/api/v1/ws/' + settingsDialog.data.id, 'Link copied to clipboard!')"
>
<span v-text="wslocation+'/api/v1/ws/'+settingsDialog.data.id"></span>
<q-tooltip> Click to copy URL </q-tooltip>
</q-btn>
<q-btn
v-else
dense
outline
unelevated
color="primary"
size="md"
@click="copyText(location + '/bitcoinswitch/api/v1/lnurl/' + settingsDialog.data.id + ',' + settingsDialog.data.key + ',' + settingsDialog.data.currency, 'Link copied to clipboard!')"
>
<span
v-text="location + '/bitcoinswitch/api/v1/lnurl/' + settingsDialog.data.id + ',' + settingsDialog.data.key + ',' + settingsDialog.data.currency, 'Link copied to clipboard!'"
></span>
<q-tooltip> Click to copy URL </q-tooltip>
</q-btn>
</center>
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
<div class="text-h6">Device string</div>
<q-btn
dense
outline
unelevated
color="primary"
size="md"
@click="copyText(wslocation, 'Link copied to clipboard!')"
>
<span v-text="wslocation"></span>
<q-tooltip> Click to copy URL </q-tooltip>
</q-btn>
</q-card>
</q-dialog>

Expand Down

0 comments on commit 246d2b5

Please sign in to comment.