Added LNURLw as image view
This commit is contained in:
@@ -59,6 +59,16 @@
|
||||
:href="props.row.withdraw_url"
|
||||
target="_blank"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
size="xs"
|
||||
icon="web_asset"
|
||||
:color="($q.dark.isActive) ? 'grey-7' : 'grey-5'"
|
||||
type="a"
|
||||
:href="'/img/' + props.row.id"
|
||||
target="_blank"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from quart import g, abort, render_template
|
||||
from http import HTTPStatus
|
||||
|
||||
import pyqrcode
|
||||
from lnbits.decorators import check_user_exists, validate_uuids
|
||||
|
||||
from . import withdraw_ext
|
||||
@@ -20,6 +20,13 @@ async def display(link_id):
|
||||
return await render_template("withdraw/display.html", link=link, unique=True)
|
||||
|
||||
|
||||
@withdraw_ext.route("/img/<link_id>")
|
||||
async def img(link_id):
|
||||
link = await get_withdraw_link(link_id, 0) or abort(HTTPStatus.NOT_FOUND, "Withdraw link does not exist.")
|
||||
qr = pyqrcode.create(link.lnurl)
|
||||
qrimage = qr.png('qrimage.png', scale=5)
|
||||
return '<img src=' + qrimage + '>'
|
||||
|
||||
@withdraw_ext.route("/print/<link_id>")
|
||||
async def print_qr(link_id):
|
||||
link = await get_withdraw_link(link_id) or abort(HTTPStatus.NOT_FOUND, "Withdraw link does not exist.")
|
||||
|
||||
Reference in New Issue
Block a user