feat: Add Flush Cache tool page to web UI
Adds a /flush-cache web page with a button to clear all cached Google Sheets data and reset refresh timers. Link added to Tools nav across all templates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
8
app.py
8
app.py
@@ -7,7 +7,7 @@ import os
|
||||
import io
|
||||
import qrcode
|
||||
import logging
|
||||
from flask import Flask, render_template, g, send_file, request, jsonify
|
||||
from flask import Flask, render_template, g, send_file, request
|
||||
|
||||
# Configure logging, allowing override via LOG_LEVEL environment variable
|
||||
log_level = os.environ.get("LOG_LEVEL", "INFO").upper()
|
||||
@@ -117,10 +117,12 @@ def index():
|
||||
# Redirect root to /adults for convenience while there are no other apps
|
||||
return '<meta http-equiv="refresh" content="0; url=/adults" />'
|
||||
|
||||
@app.route("/flush-cache", methods=["POST"])
|
||||
@app.route("/flush-cache", methods=["GET", "POST"])
|
||||
def flush_cache_endpoint():
|
||||
if request.method == "GET":
|
||||
return render_template("flush-cache.html")
|
||||
deleted = flush_cache()
|
||||
return jsonify({"status": "ok", "deleted_files": deleted})
|
||||
return render_template("flush-cache.html", flushed=True, deleted=deleted)
|
||||
|
||||
@app.route("/sync-bank")
|
||||
def sync_bank():
|
||||
|
||||
Reference in New Issue
Block a user