mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 15:56:17 +00:00
Update dashboard.py
This commit is contained in:
@@ -52,7 +52,10 @@ dictConfig({
|
|||||||
SystemStatus = SystemStatus()
|
SystemStatus = SystemStatus()
|
||||||
|
|
||||||
CONFIGURATION_PATH = os.getenv('CONFIGURATION_PATH', '.')
|
CONFIGURATION_PATH = os.getenv('CONFIGURATION_PATH', '.')
|
||||||
app = Flask("WGDashboard", template_folder=os.path.abspath("./static/app/dist"))
|
app = Flask("WGDashboard",
|
||||||
|
template_folder=os.path.abspath("./static/app/dist"),
|
||||||
|
static_folder=os.path.abspath("./static/app/dist")
|
||||||
|
)
|
||||||
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 5206928
|
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 5206928
|
||||||
app.secret_key = secrets.token_urlsafe(32)
|
app.secret_key = secrets.token_urlsafe(32)
|
||||||
|
|
||||||
@@ -1464,18 +1467,18 @@ InitWireguardConfigurationsList(startup=True)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
url_map = app.url_map
|
# url_map = app.url_map
|
||||||
app.view_functions["static"] = None
|
# app.view_functions["static"] = None
|
||||||
try:
|
# try:
|
||||||
for rule in url_map.iter_rules('static'):
|
# for rule in url_map.iter_rules('static'):
|
||||||
url_map._rules.remove(rule)
|
# url_map._rules.remove(rule)
|
||||||
except ValueError:
|
# except ValueError:
|
||||||
pass
|
# pass
|
||||||
|
#
|
||||||
app.static_url_path = f'{APP_PREFIX}/static'
|
# app.static_url_path = f'{APP_PREFIX}/static'
|
||||||
app.add_url_rule(
|
# app.add_url_rule(
|
||||||
app.static_url_path + '/<path:filename>',
|
# app.static_url_path + '/<path:filename>',
|
||||||
endpoint='static', view_func=app.send_static_file)
|
# endpoint='static', view_func=app.send_static_file)
|
||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
DashboardClients: DashboardClients = DashboardClients(WireguardConfigurations)
|
DashboardClients: DashboardClients = DashboardClients(WireguardConfigurations)
|
||||||
|
Reference in New Issue
Block a user