From 1e7017a3422827039c4092ef3c4cff0f9036481a Mon Sep 17 00:00:00 2001 From: David Hoppenbrouwers Date: Sun, 9 Oct 2022 14:39:28 +0200 Subject: [PATCH] Add restart button --- main.py | 10 ++++++++++ templates/admin/index.html | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/main.py b/main.py index 95e3fd4..3f0ff76 100644 --- a/main.py +++ b/main.py @@ -491,6 +491,16 @@ def admin_unban_user(user_id): flash(str(e), 'error') return redirect(url_for('admin')) +@app.route('/admin/restart/', methods = ['POST']) +def admin_restart(): + chk, user = _admin_check() + if not chk: + return user + + restart() + return redirect(url_for('admin')) + + def _admin_check(): user = get_user() if user is None: diff --git a/templates/admin/index.html b/templates/admin/index.html index 1ee7284..287a7f7 100644 --- a/templates/admin/index.html +++ b/templates/admin/index.html @@ -29,6 +29,11 @@
+