From a968962b40ec1ab0f00aeabd197b234964a5c373 Mon Sep 17 00:00:00 2001 From: pluja Date: Sat, 5 Sep 2020 13:25:45 +0200 Subject: [PATCH] Add instance info on settings --- app/routes.py | 6 +++++- app/templates/settings.html | 11 +++++++++++ yotter-config.json | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/routes.py b/app/routes.py index 360c96c..8fdf355 100644 --- a/app/routes.py +++ b/app/routes.py @@ -390,7 +390,11 @@ def logout(): @app.route('/settings') @login_required def settings(): - return render_template('settings.html') + instanceInfo = { + "totalUsers":db.session.query(User).count(), + "location":config['serverLocation'] + } + return render_template('settings.html', info=instanceInfo) @app.route('/export') @login_required diff --git a/app/templates/settings.html b/app/templates/settings.html index 5b54d47..c61ff0a 100644 --- a/app/templates/settings.html +++ b/app/templates/settings.html @@ -77,6 +77,17 @@ --> + + +

Instance Info

+
+
+

Total users: {{info.totalUsers}}

+
+
+

Server location: {{info.location}}

+
+
{% endblock %} diff --git a/yotter-config.json b/yotter-config.json index 438a7de..0a2db79 100644 --- a/yotter-config.json +++ b/yotter-config.json @@ -1,4 +1,5 @@ { "nitterInstance": "https://nitter.net/", - "maxInstanceUsers": 10 + "maxInstanceUsers": 10, + "serverLocation": "Germany" }