Add API endpoint to clear status and update UI with hints for golden image handling in eMMC provisioning dashboard
This commit is contained in:
@@ -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()})
|
||||
|
||||
Reference in New Issue
Block a user