fsdfds
This commit is contained in:
parent
70e32150a8
commit
ba8b92a6bc
6 changed files with 79 additions and 5 deletions
|
@ -7,6 +7,7 @@ from sqlalchemy import func
|
|||
from os import path
|
||||
import calendar
|
||||
import matplotlib.pyplot as plt
|
||||
from files.classes.mod_logs import ACTIONTYPES
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
|
@ -177,7 +178,8 @@ def log(v):
|
|||
|
||||
page = int(request.args.get("page",1))
|
||||
admin = request.args.get("admin")
|
||||
if admin: admin = get_id(admin)
|
||||
if admin: admin_id = get_id(admin)
|
||||
else: admin_id = 0
|
||||
|
||||
kind = request.args.get("kind")
|
||||
|
||||
|
@ -185,14 +187,16 @@ def log(v):
|
|||
if not (v and v.admin_level > 1):
|
||||
actions = actions.filter(ModAction.kind!="shadowban", ModAction.kind!="unshadowban", ModAction.kind!="club", ModAction.kind!="unclub", ModAction.kind!="check")
|
||||
|
||||
if admin: actions = actions.filter_by(user_id=admin)
|
||||
if admin_id: actions = actions.filter_by(user_id=admin_id)
|
||||
if kind: actions = actions.filter_by(kind=kind)
|
||||
|
||||
actions = actions.order_by(ModAction.id.desc()).offset(25*(page-1)).limit(26).all()
|
||||
next_exists=len(actions)>25
|
||||
actions=actions[:25]
|
||||
|
||||
return render_template("log.html", v=v, actions=actions, next_exists=next_exists, page=page)
|
||||
admins = [x[0] for x in g.db.query(User.username).filter(User.admin_level > 1).all()]
|
||||
|
||||
return render_template("log.html", v=v, admins=admins, types=ACTIONTYPES, admin=admin, type=kind, actions=actions, next_exists=next_exists, page=page)
|
||||
|
||||
@app.get("/log/<id>")
|
||||
@auth_desired
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue