mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-08 08:01:35 +01:00
implement simple rounds display
This commit is contained in:
26
server.py
26
server.py
@@ -28,6 +28,32 @@ def prettifyMinMaxY(computedMin, computedMax):
|
||||
else:
|
||||
return (computedMin - 100, 4000)
|
||||
|
||||
@app.route("/rounds-by-timestamp")
|
||||
def rounds():
|
||||
'''Show rounds played on the server'''
|
||||
|
||||
start = flask.request.args.get("start")
|
||||
end = flask.request.args.get("end")
|
||||
|
||||
if not start or not end:
|
||||
start = datetime.datetime.now() - datetime.timedelta(days=4000)
|
||||
end = datetime.datetime.now()
|
||||
else:
|
||||
start = datetime.datetime.fromtimestamp(start)
|
||||
end = datetime.datetime.fromtimestamp(end)
|
||||
|
||||
db = DatabaseConnection(app.config["DB_PATH"])
|
||||
rounds = db.roundsBetweenDates(start, end)
|
||||
|
||||
return flask.render_template("rounds.html", rounds=rounds)
|
||||
|
||||
|
||||
# get timestamp
|
||||
# display players
|
||||
# display rating change
|
||||
# display outcome
|
||||
# display map
|
||||
|
||||
@app.route("/player")
|
||||
def player():
|
||||
'''Show Info about Player'''
|
||||
|
||||
Reference in New Issue
Block a user