This commit is contained in:
dni ⚡ 2024-10-16 15:52:13 +02:00
commit 8394e56f5d
No known key found for this signature in database
GPG key ID: D1F416F29AD26E87
4 changed files with 36 additions and 34 deletions

View file

@ -8,11 +8,9 @@
<q-badge color="red" class="q-mb-md">Withdraw is spent.</q-badge>
{% endif %}
<a class="text-secondary" href="lightning:{{ lnurl }}">
<q-responsive :ratio="1" class="q-mx-md">
<lnbits-qrcode
:value="this.here + '/?lightning={{lnurl }}'"
></lnbits-qrcode>
</q-responsive>
<lnbits-qrcode
:value="this.here + '/?lightning={{lnurl }}'"
></lnbits-qrcode>
</a>
</div>
<div class="row q-mt-lg q-gutter-sm">

View file

@ -38,14 +38,16 @@
v-model:pagination="withdrawLinksTable.pagination"
@request="getWithdrawLinks"
>
{% raw %}
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width></q-th>
<q-th auto-width></q-th>
<q-th v-for="col in props.cols" :key="col.name" :props="props">
{{ col.label }}
</q-th>
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
v-text="col.label"
></q-th>
<q-th auto-width></q-th>
</q-tr>
</template>
@ -114,17 +116,22 @@
color="pink"
></q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
{{ col.value }}
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
v-text="col.value"
>
</q-td>
<q-td>
<q-icon v-if="props.row.webhook_url" size="14px" name="http">
<q-tooltip>Webhook to {{ props.row.webhook_url}}</q-tooltip>
<q-tooltip
>Webhook to <span v-text="props.row.webhook_url"></span
></q-tooltip>
</q-icon>
</q-td>
</q-tr>
</template>
{% endraw %}
</q-table>
</q-card-section>
</q-card>
@ -408,32 +415,29 @@
<q-dialog v-model="qrCodeDialog.show" position="top">
<q-card v-if="qrCodeDialog.data" class="q-pa-lg lnbits__dialog-card">
<q-responsive :ratio="1" class="q-mx-xl q-mb-md">
<lnbits-qrcode
:value="qrCodeDialog.data.url + '/?lightning=' + qrCodeDialog.data.lnurl"
></lnbits-qrcode>
{% raw %}
</q-responsive>
<lnbits-qrcode
:value="qrCodeDialog.data.url + '/?lightning=' + qrCodeDialog.data.lnurl"
></lnbits-qrcode>
<p style="word-break: break-all">
<strong>ID:</strong> {{ qrCodeDialog.data.id }}<br />
<strong>Unique:</strong> {{ qrCodeDialog.data.is_unique }}<span
v-if="qrCodeDialog.data.is_unique"
class="text-deep-purple"
>
<strong>ID:</strong> <span v-text="qrCodeDialog.data.id"></span><br />
<strong>Unique:</strong>
<span v-text="qrCodeDialog.data.is_unique"></span>
<span v-if="qrCodeDialog.data.is_unique" class="text-deep-purple">
(QR code will change after each withdrawal)</span
><br />
<strong>Max. withdrawable:</strong> {{
qrCodeDialog.data.max_withdrawable }} sat<br />
<strong>Wait time:</strong> {{ qrCodeDialog.data.wait_time }} seconds<br />
<strong>Withdraws:</strong> {{ qrCodeDialog.data.used }} / {{
qrCodeDialog.data.uses }}
<strong>Max. withdrawable:</strong>
<span v-text="qrCodeDialog.data.max_withdrawable"></span> sat<br />
<strong>Wait time:</strong>
<span v-text="qrCodeDialog.data.wait_time"></span> seconds<br />
<strong>Withdraws:</strong>
<span v-text="qrCodeDialog.data.used"></span>/
<span v-text="qrCodeDialog.data.uses"></span><br />
<q-linear-progress
:value="qrCodeDialog.data.used / qrCodeDialog.data.uses"
color="primary"
class="q-mt-sm"
></q-linear-progress>
</p>
{% endraw %}
<div class="row q-mt-lg q-gutter-sm">
<q-btn
outline

View file

@ -36,7 +36,7 @@ async def display(request: Request, link_id):
"withdraw/display.html",
{
"request": request,
"link": link.dict(),
"link": link.json(),
"lnurl": link.lnurl(req=request),
"unique": True,
},
@ -83,7 +83,7 @@ async def print_qr(request: Request, link_id):
return withdraw_renderer().TemplateResponse(
"withdraw/print_qr.html",
{"request": request, "link": link.dict(), "unique": False},
{"request": request, "link": link.json(), "unique": False},
)
links = []
count = 0
@ -130,7 +130,7 @@ async def csv(request: Request, link_id):
return withdraw_renderer().TemplateResponse(
"withdraw/csv.html",
{"request": request, "link": link.dict(), "unique": False},
{"request": request, "link": link.json(), "unique": False},
)
links = []
count = 0

View file

@ -9,8 +9,8 @@ import shortuuid
from fastapi import APIRouter, HTTPException, Request, Response
from fastapi.responses import JSONResponse
from fastapi.routing import APIRoute
from lnbits.core.models import Payment
from lnbits.core.crud import update_payment
from lnbits.core.models import Payment
from lnbits.core.services import pay_invoice
from loguru import logger