diff --git a/tasks.py b/tasks.py index b0d3ac5..6854184 100644 --- a/tasks.py +++ b/tasks.py @@ -7,7 +7,7 @@ from lnbits.core import db as core_db from lnbits.core.models import Payment -from lnbits.core.services import websocketUpdater +from lnbits.core.services import websocket_updater from lnbits.helpers import get_current_extension_name from lnbits.tasks import register_invoice_listener @@ -65,11 +65,11 @@ async def on_invoice_paid(payment: Payment) -> None: except (httpx.ConnectError, httpx.RequestError): await mark_webhook_sent(payment, -1) if payment.extra.get("comment"): - await websocketUpdater( + await websocket_updater( copilot.id, str(data) + "-" + str(payment.extra.get("comment")) ) - await websocketUpdater(copilot.id, str(data) + "-none") + await websocket_updater(copilot.id, str(data) + "-none") async def mark_webhook_sent(payment: Payment, status: int) -> None: diff --git a/templates/copilot/index.html b/templates/copilot/index.html index 380c290..eabe167 100644 --- a/templates/copilot/index.html +++ b/templates/copilot/index.html @@ -220,15 +220,51 @@
+ +
+
+ + > + + + + + Upload small image + + +
+
min="10" > + +
expand-separator label="Payment threshold 2 (Must be higher than last)" > - + -
+
+ +
+
+ + > + + + + + Upload small image + + +
@@ -312,20 +382,52 @@
expand-separator label="Payment threshold 3 (Must be higher than last)" > - + -
+
+
+ +
+ + > + + + + + Upload small image + + +
@@ -461,6 +563,7 @@
data: {} }, formDialogCopilot: { + toggle: false, show: false, data: { lnurl_toggle: false, diff --git a/views_api.py b/views_api.py index 3755db4..2910062 100644 --- a/views_api.py +++ b/views_api.py @@ -3,7 +3,7 @@ from fastapi import Depends, Request from fastapi.exceptions import HTTPException -from lnbits.core.services import websocketUpdater +from lnbits.core.services import websocket_updater from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key from . import copilot_ext @@ -97,7 +97,7 @@ async def api_copilot_ws_relay(copilot_id: str, comment: str, data: str): status_code=HTTPStatus.NOT_FOUND, detail="Copilot does not exist" ) try: - await websocketUpdater(copilot_id, str(data) + "-" + str(comment)) + await websocket_updater(copilot_id, str(data) + "-" + str(comment)) except: raise HTTPException(status_code=HTTPStatus.FORBIDDEN, detail="Not your copilot") return ""