Skip to content

Commit

Permalink
rc5 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Oct 16, 2024
1 parent 59b3941 commit 8394e56
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
8 changes: 3 additions & 5 deletions templates/withdraw/display.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
54 changes: 29 additions & 25 deletions templates/withdraw/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ <h5 class="text-subtitle1 q-my-none">Withdraw links</h5>
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>
Expand Down Expand Up @@ -114,17 +116,22 @@ <h5 class="text-subtitle1 q-my-none">Withdraw links</h5>
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>
Expand Down Expand Up @@ -408,32 +415,29 @@ <h6 class="text-subtitle1 q-my-none">

<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
Expand Down
6 changes: 3 additions & 3 deletions views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion views_lnurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
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

Expand Down

0 comments on commit 8394e56

Please sign in to comment.