2023-01-19 16:02:57 +00:00
|
|
|
from sanic.response import html
|
2023-08-06 10:47:07 +00:00
|
|
|
from sanic import Blueprint
|
2023-01-19 16:02:57 +00:00
|
|
|
from ext import *
|
|
|
|
|
|
|
|
bp = Blueprint("stats", url_prefix="/manage")
|
|
|
|
|
|
|
|
@bp.route("/nosecount")
|
|
|
|
async def nose_count(request, order: Order):
|
|
|
|
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: len(x[1].room_members), reverse=True) if value.status not in ['c', 'e']}
|
|
|
|
|
|
|
|
tpl = request.app.ctx.tpl.get_template('nosecount.html')
|
|
|
|
return html(tpl.render(orders=orders, order=order))
|