From 8b9880ce44d00b2ac1e37a04109c1021be35bed2 Mon Sep 17 00:00:00 2001 From: Karl Date: Sat, 19 Jul 2025 09:16:15 +0100 Subject: [PATCH] modify dns in config --- app.py | 12 +++++++++++- templates/config_dashboard.html | 29 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 19c5676..c3685e9 100644 --- a/app.py +++ b/app.py @@ -315,7 +315,17 @@ def config_dashboard(): """Renders the configuration dashboard.""" if not session.get('config_logged_in'): return redirect(url_for('config')) - return render_template('config_dashboard.html') + + DNS_FILE = os.path.join(os.path.dirname(__file__), '..', 'KTVManager_python', 'ktvmanager', 'lib', 'DNS_list.txt') + + def read_dns_list(): + if not os.path.exists(DNS_FILE): + return [] + with open(DNS_FILE, 'r') as f: + return [line.strip() for line in f.readlines()] + + dns_list = read_dns_list() + return render_template('config_dashboard.html', dns_list=dns_list) @app.route('/check-expiring-accounts', methods=['POST']) def check_expiring_accounts(): diff --git a/templates/config_dashboard.html b/templates/config_dashboard.html index ec23879..fe20854 100644 --- a/templates/config_dashboard.html +++ b/templates/config_dashboard.html @@ -8,6 +8,35 @@

Welcome to the configuration page.

+ +
+
+ DNS Manager +
+
+
+
+ +
+ +
+
+
+
+ +
{% endblock %}