From f6f23314955e13015db7f3e80b48d0fd2458990d Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Thu, 28 Oct 2021 23:02:29 +0800 Subject: Route for /admin/logs --- jimbrella/admin.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- cgit v1.2.3