Merge pull request #1189 from lnbits/cashu/wallet/ui_updates

Cashu wallet: display mint name
This commit is contained in:
calle 2022-12-11 01:01:20 +01:00 committed by GitHub
commit 0cf6ae01b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View File

@ -125,6 +125,8 @@ class Database(Compat):
import psycopg2 # type: ignore
def _parse_timestamp(value, _):
if value is None:
return None
f = "%Y-%m-%d %H:%M:%S.%f"
if not "." in value:
f = "%Y-%m-%d %H:%M:%S"
@ -149,14 +151,7 @@ class Database(Compat):
psycopg2.extensions.register_type(
psycopg2.extensions.new_type(
(1184, 1114),
"TIMESTAMP2INT",
_parse_timestamp
# lambda value, curs: time.mktime(
# datetime.datetime.strptime(
# value, "%Y-%m-%d %H:%M:%S.%f"
# ).timetuple()
# ),
(1184, 1114), "TIMESTAMP2INT", _parse_timestamp
)
)
else:

View File

@ -1,5 +1,5 @@
{% extends "public.html" %} {% block toolbar_title %} {% raw %} {{name}} Cashu
{% endraw %} {% endblock %} {% block footer %}{% endblock %} {% block
{% extends "public.html" %} {% block toolbar_title %} {% raw %} Cashu {% endraw
%} - {{mint_name}} {% endblock %} {% block footer %}{% endblock %} {% block
page_container %}
<q-page-container>
<q-page>

View File

@ -27,11 +27,17 @@ async def index(
@cashu_ext.get("/wallet")
async def wallet(request: Request, mint_id: str):
cashu = await get_cashu(mint_id)
if not cashu:
raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, detail="Mint does not exist."
)
return cashu_renderer().TemplateResponse(
"cashu/wallet.html",
{
"request": request,
"web_manifest": f"/cashu/manifest/{mint_id}.webmanifest",
"mint_name": cashu.name,
},
)
@ -41,7 +47,7 @@ async def cashu(request: Request, mintID):
cashu = await get_cashu(mintID)
if not cashu:
raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, detail="TPoS does not exist."
status_code=HTTPStatus.NOT_FOUND, detail="Mint does not exist."
)
return cashu_renderer().TemplateResponse(
"cashu/mint.html",
@ -54,7 +60,7 @@ async def manifest(cashu_id: str):
cashu = await get_cashu(cashu_id)
if not cashu:
raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, detail="TPoS does not exist."
status_code=HTTPStatus.NOT_FOUND, detail="Mint does not exist."
)
return {