diff --git a/chromium-setup/emmc-provisioning/dashboard/app.py b/chromium-setup/emmc-provisioning/dashboard/app.py index ab5ebe0..00aa23d 100644 --- a/chromium-setup/emmc-provisioning/dashboard/app.py +++ b/chromium-setup/emmc-provisioning/dashboard/app.py @@ -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()}) diff --git a/chromium-setup/emmc-provisioning/dashboard/templates/index.html b/chromium-setup/emmc-provisioning/dashboard/templates/index.html index c9861ea..3801639 100644 --- a/chromium-setup/emmc-provisioning/dashboard/templates/index.html +++ b/chromium-setup/emmc-provisioning/dashboard/templates/index.html @@ -368,6 +368,10 @@ Waiting for device
+