New Route that feeds live image data

This commit is contained in:
2025-06-03 08:52:40 +02:00
parent 8214e36a64
commit f00e87fbe8
3 changed files with 40 additions and 1 deletions

View File

@@ -1,4 +1,11 @@
from flask import Blueprint, render_template, request, jsonify, flash
from flask import (
Blueprint,
render_template,
request,
jsonify,
flash,
send_from_directory,
)
from application.dashboard.models import AllowedPlate, LoggedItem
from application import db
from application.dashboard.forms import npForm
@@ -48,3 +55,20 @@ def add():
return render_template(
"add.html", form=npForm(formdata=None), plates=Plates
)
@dash_blueprint.route("/live", methods=["GET"])
@login_required
def live():
return render_template("live.html")
@dash_blueprint.route("/live_image", methods=["GET"])
@login_required
def live_image():
return send_from_directory(
"static/live",
"feed.png",
as_attachment=False,
conditional=True,
)