2022-09-07 16:44:59 +02:00
|
|
|
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
|
2022-09-26 16:51:44 +02:00
|
|
|
from datetime import datetime, timezone
|
2022-09-07 16:44:59 +02:00
|
|
|
|
|
|
|
bp = Blueprint('redeem_dashboard', __name__)
|
|
|
|
|
|
|
|
@bp.route('/dashboard',methods=['GET'])
|
|
|
|
def dashboard():
|
2022-10-12 15:48:57 +02:00
|
|
|
db = get_db()
|
|
|
|
queue = pretty_redeem_queue(db)
|
|
|
|
counters = all_counters(db)
|
2022-09-26 16:51:44 +02:00
|
|
|
utc_timezone = timezone.utc
|
|
|
|
return render_template('dashboard.html',
|
|
|
|
queue=queue,
|
2022-10-12 15:48:57 +02:00
|
|
|
counters=counters,
|
2022-09-26 16:51:44 +02:00
|
|
|
utc_timezone=utc_timezone)
|