imaging dashboard: add Clear all button + endpoint

New /imaging/delete_all endpoint wipes every per-bay JSON in IMAGING_DIR
via imaging_status.delete_all_sessions(). Template adds "Clear all"
outline-danger button next to the count badge, gated on sessions list
non-empty, with confirm() prompt naming the count.

Deployed via scp + systemctl restart pxe-webapp on 172.16.9.1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-05-16 15:58:31 -04:00
parent 7f097013fc
commit 3aabd47571
3 changed files with 33 additions and 1 deletions

View File

@@ -496,6 +496,14 @@ def imaging_delete_session(serial):
return redirect(url_for("imaging_dashboard"))
@app.route("/imaging/delete_all", methods=["POST"])
def imaging_delete_all():
n = imaging_status.delete_all_sessions()
audit("IMAGING_DELETE_ALL", str(n))
flash(f"Cleared {n} imaging session(s).", "success")
return redirect(url_for("imaging_dashboard"))
@app.route("/imaging/<serial>/laps", methods=["POST"])
def imaging_set_laps(serial):
"""Save (or clear with empty value) the LAPS password for a bay so it