Add API endpoint to clear status and update UI with hints for golden image handling in eMMC provisioning dashboard

This commit is contained in:
nearxos
2026-02-18 14:29:38 +02:00
parent c42e7951d0
commit ccdace36bc
2 changed files with 30 additions and 0 deletions

View File

@@ -151,6 +151,22 @@ def api_status():
return jsonify(read_status())
@app.route("/api/status-clear", methods=["POST"])
def api_status_clear():
"""Reset status to idle (e.g. to dismiss a 'Golden image not found' error so you can try again)."""
try:
with open(STATUS_FILE, "w") as f:
json.dump({
"phase": "idle",
"message": DEFAULT_STATUS["message"],
"progress": None,
"updated": None,
}, f)
return jsonify({"ok": True})
except (PermissionError, OSError):
return jsonify({"ok": False, "error": "Could not write status"}), 500
@app.route("/api/log")
def api_log():
return jsonify({"log": read_log_tail()})