diff --git a/lnbits/__main__.py b/lnbits/__main__.py index ff42138c..793f52dc 100644 --- a/lnbits/__main__.py +++ b/lnbits/__main__.py @@ -1,2 +1,3 @@ from .app import create_app + app = create_app() diff --git a/lnbits/app.py b/lnbits/app.py index 4a65e1e7..f15e54e4 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -16,7 +16,6 @@ from fastapi.staticfiles import StaticFiles from loguru import logger from lnbits.core.tasks import register_task_listeners - from lnbits.settings import WALLET, check_admin_settings, settings from .commands import migrate_databases @@ -60,14 +59,13 @@ def create_app() -> FastAPI: name="core_static", ) - origins = ["*"] - app.add_middleware( - CORSMiddleware, allow_origins=origins, allow_methods=["*"], allow_headers=["*"] + CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"] ) + # TODO: why those 2? g().config = settings - g().base_url = f"http://{settings.host}:{settings.port}" + # g().base_url = f"http://{settings.host}:{settings.port}" app.add_middleware(GZipMiddleware, minimum_size=1000) @@ -86,7 +84,6 @@ async def check_funding_source() -> None: # def signal_handler(signal, frame): # logger.debug(f"SIGINT received, terminating LNbits.") # sys.exit(1) - # signal.signal(signal.SIGINT, signal_handler) while True: try: diff --git a/lnbits/extensions/admin/templates/admin/_tab_funding.html b/lnbits/extensions/admin/templates/admin/_tab_funding.html index 2ed0aae2..715f0e09 100644 --- a/lnbits/extensions/admin/templates/admin/_tab_funding.html +++ b/lnbits/extensions/admin/templates/admin/_tab_funding.html @@ -26,17 +26,8 @@ filled v-model="data.settings.lnbits_backend_wallet_class" hint="Select the active funding wallet" - :options="data.settings.lnbits_funding_sources" + :options="data.settings.lnbits_allowed_funding_sources" > -
-
- -

Fee reserve

@@ -72,7 +63,7 @@ dense type="text" filled - v-model="wallet.data.id" + v-model="wallet.id" label="Wallet ID" hint="Use the wallet ID to topup any wallet" > @@ -83,7 +74,7 @@ dense type="number" filled - v-model="wallet.data.amount" + v-model="wallet.amount" label="Topup amount" >
@@ -100,59 +91,21 @@

Funding Sources

- {% raw %} - - + + - - - - - {% endraw %} diff --git a/lnbits/extensions/admin/templates/admin/_tab_server.html b/lnbits/extensions/admin/templates/admin/_tab_server.html index 2924e6a4..7eed90f9 100644 --- a/lnbits/extensions/admin/templates/admin/_tab_server.html +++ b/lnbits/extensions/admin/templates/admin/_tab_server.html @@ -70,9 +70,5 @@ - -
- Save -
diff --git a/lnbits/extensions/admin/templates/admin/_tab_theme.html b/lnbits/extensions/admin/templates/admin/_tab_theme.html index 41dc0447..9374b0b4 100644 --- a/lnbits/extensions/admin/templates/admin/_tab_theme.html +++ b/lnbits/extensions/admin/templates/admin/_tab_theme.html @@ -66,7 +66,7 @@ v-model="data.settings.lnbits_theme" multiple hint="Choose themes available for users" - :options="themes" + :options="data.settings.lnbits_theme_options" label="Themes" >
@@ -114,9 +114,5 @@ - -
- Save -
diff --git a/lnbits/extensions/admin/templates/admin/_tab_users.html b/lnbits/extensions/admin/templates/admin/_tab_users.html index 3eb53ac4..414de775 100644 --- a/lnbits/extensions/admin/templates/admin/_tab_users.html +++ b/lnbits/extensions/admin/templates/admin/_tab_users.html @@ -68,10 +68,9 @@

Admin Extensions


@@ -83,14 +82,10 @@ v-model="data.settings.lnbits_disabled_extensions" multiple hint="Disable extensions *amilk disabled by default as resource heavy" - :options="options" label="Disable extensions" >
-
- Save -
diff --git a/lnbits/extensions/admin/templates/admin/index.html b/lnbits/extensions/admin/templates/admin/index.html index 87e89321..270d5131 100644 --- a/lnbits/extensions/admin/templates/admin/index.html +++ b/lnbits/extensions/admin/templates/admin/index.html @@ -1,5 +1,12 @@ {% extends "base.html" %} {% from "macros.jinja" import window_vars with context %} {% block page %} +
+
+ + + +
+
@@ -29,7 +36,7 @@
- + {% include "admin/_tab_funding.html" %} {% include "admin/_tab_users.html" %} {% include "admin/_tab_server.html" %} {% @@ -42,68 +49,20 @@ {% endblock %} {% block scripts %} {{ window_vars(user) }}