From 681558126daf23e2728b2b2b64348d3111a8bfbc Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Wed, 2 Jul 2025 18:51:58 +0800 Subject: [PATCH] Update --- src/client.py | 6 +----- src/dashboard.py | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client.py b/src/client.py index b5bfefb..a187b28 100644 --- a/src/client.py +++ b/src/client.py @@ -28,11 +28,7 @@ def login_required(f): def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration], dashboardConfig: DashboardConfig): from modules.DashboardClients import DashboardClients - - - - with current_app.app_context(): - DashboardClients = DashboardClients(wireguardConfigurations) + client = Blueprint('client', __name__, template_folder=os.path.abspath("./static/client/dist")) prefix = f'{dashboardConfig.GetConfig("Server", "app_prefix")[1]}/client' diff --git a/src/dashboard.py b/src/dashboard.py index 0bdcb5d..c7e5c9c 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1284,7 +1284,8 @@ DashboardLogger: DashboardLogger = DashboardLogger() InitWireguardConfigurationsList(startup=True) -app.register_blueprint(createClientBlueprint(WireguardConfigurations, DashboardConfig)) +with app.app_context(): + app.register_blueprint(createClientBlueprint(WireguardConfigurations, DashboardConfig)) def startThreads(): bgThread = threading.Thread(target=peerInformationBackgroundThread, daemon=True)