From f633a9654a538d96c9d050e4be8c59d733a5d49b 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 b5bfefba..a187b287 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 0bdcb5d0..c7e5c9cf 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)