26 lines
891 B
Python
26 lines
891 B
Python
from flask import render_template, Blueprint, Response
|
|
from sqlalchemy import desc
|
|
|
|
from app.models.base import Group
|
|
from app.models.onions import Eotk
|
|
|
|
bp = Blueprint("eotk", __name__)
|
|
|
|
|
|
@bp.route("/list")
|
|
def eotk_list():
|
|
instances = Eotk.query.filter(Eotk.destroyed == None).order_by(desc(Eotk.added)).all()
|
|
return render_template("list.html.j2",
|
|
section="eotk",
|
|
title="EOTK Instances",
|
|
item="eotk",
|
|
items=instances)
|
|
|
|
|
|
@bp.route("/conf/<group_id>")
|
|
def eotk_conf(group_id: int):
|
|
from app import app
|
|
group = Group.query.filter(Group.id == group_id).first()
|
|
return Response(render_template("sites.conf.j2",
|
|
bypass_token=app.config["BYPASS_TOKEN"],
|
|
group=group), content_type="text/plain")
|