Update documentation and scripts for revision tracking and cloud-init enhancements</message>
<message>Introduce a revision tracking system across project files, allowing for easier identification of changes. Update the README files to include instructions for bumping revisions and auto-bumping on commits. Additionally, enhance cloud-init scripts with revision comments for better version control. Modify the dashboard API to improve build status management, including a forced clear option for stuck statuses, enhancing user experience and operational reliability.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Revision: 2
|
||||
"""
|
||||
Flask dashboard for CM4 eMMC provisioning.
|
||||
Public home: deploy only (status, logs, how to connect). No login.
|
||||
@@ -1632,10 +1633,12 @@ def api_build_cloudinit_cancel():
|
||||
@app.route("/api/build-cloudinit-status-clear", methods=["POST"])
|
||||
@require_admin
|
||||
def api_build_cloudinit_status_clear():
|
||||
"""Clear build status to idle (so message is cleared after cancel/done/error)."""
|
||||
"""Clear build status to idle (so message is cleared after cancel/done/error).
|
||||
Use ?force=1 to clear even when status is stuck (e.g. build died during finalizing)."""
|
||||
st = _build_status_read()
|
||||
force = request.args.get("force") in ("1", "true", "yes")
|
||||
busy = st.get("phase") in ("downloading", "decompressing", "injecting", "finalizing", "resolving")
|
||||
if busy:
|
||||
if busy and not force:
|
||||
return jsonify({"ok": False, "error": "Cannot clear while build is in progress"}), 409
|
||||
_build_status_write("idle", "", None, None)
|
||||
return jsonify({"ok": True})
|
||||
|
||||
Reference in New Issue
Block a user