Tlapbot/tlapbot/owncast_redeem_dashboard.py

19 lines
594 B
Python
Raw Normal View History

from flask import render_template, Blueprint
from tlapbot.db import get_db
2022-10-13 13:53:42 +02:00
from tlapbot.owncast_helpers import pretty_redeem_queue, all_counters
from datetime import datetime, timezone
bp = Blueprint('redeem_dashboard', __name__)
2022-10-17 18:47:30 +02:00
@bp.route('/dashboard', methods=['GET'])
def dashboard():
db = get_db()
queue = pretty_redeem_queue(db)
counters = all_counters(db)
utc_timezone = timezone.utc
return render_template('dashboard.html',
queue=queue,
counters=counters,
2022-10-17 18:47:30 +02:00
utc_timezone=utc_timezone)