basic webmanifest thing, must be improved.
This commit is contained in:
parent
05a0861601
commit
0f998419e7
2 changed files with 39 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
<!---->
|
<!---->
|
||||||
{% block scripts %} {{ window_vars(user, wallet) }}
|
{% block scripts %} {{ window_vars(user, wallet) }}
|
||||||
<script src="/core/static/js/wallet.js"></script>
|
<script src="/core/static/js/wallet.js"></script>
|
||||||
|
<link rel="manifest" href="/manifest/{{ user.id }}.webmanifest">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<!---->
|
<!---->
|
||||||
{% block title %} {{ wallet.name }} - {{ SITE_TITLE }} {% endblock %}
|
{% block title %} {{ wallet.name }} - {{ SITE_TITLE }} {% endblock %}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@ from http import HTTPStatus
|
||||||
from quart import (
|
from quart import (
|
||||||
g,
|
g,
|
||||||
abort,
|
abort,
|
||||||
redirect,
|
jsonify,
|
||||||
request,
|
request,
|
||||||
|
redirect,
|
||||||
render_template,
|
render_template,
|
||||||
send_from_directory,
|
send_from_directory,
|
||||||
url_for,
|
url_for,
|
||||||
|
|
@ -165,3 +166,39 @@ async def lnurlwallet():
|
||||||
await trio.sleep(3)
|
await trio.sleep(3)
|
||||||
|
|
||||||
return redirect(url_for("core.wallet", usr=user.id, wal=wallet.id))
|
return redirect(url_for("core.wallet", usr=user.id, wal=wallet.id))
|
||||||
|
|
||||||
|
|
||||||
|
@core_app.route("/manifest/<usr>.webmanifest")
|
||||||
|
async def manifest(usr: str):
|
||||||
|
user = await get_user(usr)
|
||||||
|
if not user:
|
||||||
|
return "", HTTPStatus.NOT_FOUND
|
||||||
|
|
||||||
|
return jsonify(
|
||||||
|
{
|
||||||
|
"short_name": "LNbits",
|
||||||
|
"name": "LNbits Wallet",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "https://cdn.jsdelivr.net/gh/lnbits/lnbits@0.3.0/docs/logos/lnbits.png",
|
||||||
|
"type": "image/png",
|
||||||
|
"sizes": "900x900",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": "/wallet?usr=" + usr,
|
||||||
|
"background_color": "#3367D6",
|
||||||
|
"description": "Weather forecast information",
|
||||||
|
"display": "standalone",
|
||||||
|
"scope": "/",
|
||||||
|
"theme_color": "#3367D6",
|
||||||
|
"shortcuts": [
|
||||||
|
{
|
||||||
|
"name": wallet.name,
|
||||||
|
"short_name": wallet.name,
|
||||||
|
"description": wallet.name,
|
||||||
|
"url": "/wallet?usr=" + usr + "&wal=" + wallet.id,
|
||||||
|
}
|
||||||
|
for wallet in user.wallets
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue