mirror of
https://github.com/lnbits/lnbits.git
synced 2025-08-03 07:22:28 +02:00
feat: display mint name
This commit is contained in:
11
lnbits/db.py
11
lnbits/db.py
@@ -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:
|
||||
|
@@ -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>
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user