feat(trip-cluster): master/detail review routes + templates + clusterReview JS
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
from flask import Blueprint
|
||||
from flask import Blueprint, current_app, render_template
|
||||
from photoflow.core import Store
|
||||
|
||||
bp = Blueprint("nav", __name__)
|
||||
|
||||
|
||||
def _store():
|
||||
cfg = current_app.config["APP_CONFIG"]
|
||||
return Store(cfg.db_path).connect()
|
||||
|
||||
|
||||
@bp.route("/health")
|
||||
def health():
|
||||
return "ok"
|
||||
@@ -10,4 +16,9 @@ def health():
|
||||
|
||||
@bp.route("/")
|
||||
def index():
|
||||
return "trip-cluster"
|
||||
s = _store()
|
||||
clusters = s.clusters_by_attention()
|
||||
stats = {"assets": len(s.all_assets()), "clusters": len(clusters),
|
||||
"pending": sum(1 for c in clusters if c.status == "pending")}
|
||||
s.close()
|
||||
return render_template("review.html", clusters=clusters, stats=stats)
|
||||
|
||||
Reference in New Issue
Block a user