summaryrefslogtreecommitdiff
path: root/jimbrella/admin.py
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-28 23:02:29 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-28 23:02:53 +0800
commitf6f23314955e13015db7f3e80b48d0fd2458990d (patch)
treeca4852bf0dcf8f89f9b3cfc69c84ef498f15ac8b /jimbrella/admin.py
parent41e1645f4a90d44db88efe8ad843bd6d7ac64f6f (diff)
Route for /admin/logs
Diffstat (limited to 'jimbrella/admin.py')
-rw-r--r--jimbrella/admin.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/jimbrella/admin.py b/jimbrella/admin.py
index 04a3f88..9a9f6c8 100644
--- a/jimbrella/admin.py
+++ b/jimbrella/admin.py
@@ -1,6 +1,7 @@
from flask import Blueprint, request, session, render_template, redirect, url_for, abort
from user_agents import parse as user_agent
from .database import Database
+from .admin_log import AdminLog
from .users import Users
from .exceptions import *
from .config import *
@@ -8,6 +9,7 @@ from .config import *
bp = Blueprint("admin", __name__, url_prefix="/admin")
db = Database(DATABASE_PATH)
users = Users(USERS_PATH)
+admin_log = AdminLog(ADMIN_LOG_PATH)
@bp.before_request
@@ -84,3 +86,9 @@ def umbrellas_edit():
pass # impossible on web console
return redirect(url_for("admin.umbrellas"))
+
+
+@bp.route("/logs")
+def logs():
+ logs = admin_log.read()
+ return render_template("admin/logs.html", logs=logs)