Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "lnbits-satspay"
version = "0.0.0"
description = "LNbits, free and open-source Lightning wallet and accounts system."
authors = ["Alan Bits <alan@lnbits.com>"]
package-mode = false

[tool.poetry.dependencies]
python = "^3.10 | ^3.9"
Expand Down
10 changes: 6 additions & 4 deletions static/js/display.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
window.app = Vue.createApp({
el: '#vue',
mixins: [window.windowMixin],
delimiters: ['${', '}'],
data() {
return {
charge: mapCharge(charge_data),
Expand All @@ -20,7 +19,7 @@ window.app = Vue.createApp({
return `${url}/address/${this.charge.onchainaddress}`
},
unifiedQR() {
const bitcoin = (this.charge.onchainaddress || '').toUpperCase()
const bitcoin = (this.charge.onchainaddress ?? '').toUpperCase()
let queryString = `bitcoin:${bitcoin}?amount=${(
this.charge.amount / 1e8
).toFixed(8)}`
Expand All @@ -38,7 +37,7 @@ window.app = Vue.createApp({
}
},
methods: {
initWs: async function () {
async initWs() {
const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws'
const url = `${protocol}://${window.location.host}/satspay/${this.charge.id}/ws`
this.ws = new WebSocket(url)
Expand Down Expand Up @@ -75,7 +74,10 @@ window.app = Vue.createApp({
})
}
},
created: async function () {
async created() {
if (!this.charge.onchainaddress) {
this.tab = 'ln'
}
// add custom-css to make overrides easier
if (this.charge.custom_css) {
document.body.setAttribute('id', 'custom-css')
Expand Down
23 changes: 12 additions & 11 deletions templates/satspay/display.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
<div class="col-lg-4 col-md-6 col-sm-8 col-xs-10">
<q-card>
<q-card-section class="text-center">
<div class="text-h4">${charge.name || 'LNbits SatsPay'}</div>
<div class="text-h4" v-text="charge.name || 'LNbits SatsPay'"></div>
<div
class="text-subtitle1"
v-for="line in charge.description.split('\n')"
>
${line}
</div>
v-text="line"
></div>
</q-card-section>
<satspay-time-elapsed :charge="charge"></satspay-time-elapsed>
<q-card-section>
Expand All @@ -19,8 +18,8 @@
<span
class="text-uppercase text-secondary cursor-pointer"
@click="copyText(charge.id)"
>${charge.id}</span
>
v-text="charge.id"
></span>
</q-item-label>
<q-item dense>
<q-item-section>
Expand Down Expand Up @@ -56,7 +55,8 @@

<q-item-section side>
<q-badge color="gray">
<span class="text-subtitle2">${charge.pending} sats</span>
<span class="text-subtitle2" v-text="charge.pending"></span>
<span>&nbsp;sats</span>
</q-badge>
</q-item-section>
</q-item>
Expand All @@ -68,10 +68,11 @@

<q-item-section side>
<q-badge color="green">
<span class="text-subtitle2"
>${charge.amount - charge.balance > 0 ? charge.amount -
charge.balance : 0} sats</span
>
<span
class="text-subtitle2"
v-text="charge.amount - charge.balance > 0 ? charge.amount - charge.balance : 0"
></span>
<span>&nbsp;sats</span>
</q-badge>
</q-item-section>
</q-item>
Expand Down