Webapp: fix six live bugs found in the page inventory

- Report view: the hero summarised only the first erasure, so a drive whose
  Purge failed and Clear fallback succeeded showed Failed while the list said
  Successful. It now uses the per-drive outcome (report_result) and lists the
  standards that wiped each drive.
- To-do and ServiceNow: reports with no usable document id could never be
  ticked or cleared (400). They are now tracked by file name (file:<name>).
- Imaging: the LAPS password field is masked, with a Show/Hide toggle.
- Imaging: succeeded sessions not updated for ACTIVE_WINDOW_HOURS are hidden
  from the dashboard (failed and in-progress always stay), with Show all.
- Enrollment: the active SFLD package can no longer be deleted, which left
  ppkg.conf pointing at a missing file; its row is marked Active.
- Import: confirm before importing, saying upload-folder sources are moved
  and same-name files in the image are overwritten.
This commit is contained in:
cproudlock
2026-10-14 13:29:00 -04:00
parent 24b4d9df66
commit dfd57bef17
10 changed files with 108 additions and 21 deletions

View File

@@ -814,7 +814,11 @@ def blancco_view_report(filename):
except Exception as ex:
flash(f"Failed to parse {filename}: {ex}", "danger")
return redirect(url_for("blancco_reports"))
return render_template("report_view.html", filename=filename, data=data)
# The hero summarises per drive: a drive counts as wiped if any of its
# erasures succeeded (Purge failing then Clear succeeding is a pass).
outcomes = blancco_report.drive_outcomes(data)
return render_template("report_view.html", filename=filename, data=data,
result=blancco_report.report_result(data), outcomes=outcomes)
@app.route("/reports/delete/<filename>", methods=["POST"])
@@ -836,8 +840,13 @@ def blancco_delete_report(filename):
@app.route("/imaging")
def imaging_dashboard():
show_all = request.args.get("all") == "1"
sessions = imaging_status.list_sessions()
return render_template("imaging.html", sessions=sessions)
hidden = 0
if not show_all:
sessions, hidden = imaging_status.hide_stale(sessions)
return render_template("imaging.html", sessions=sessions, hidden=hidden,
show_all=show_all, window_hours=imaging_status.ACTIVE_WINDOW_HOURS)
@app.route("/imaging/tiles")
@@ -846,6 +855,8 @@ def imaging_tiles_partial():
SSE/polling refresh to swap #imaging-tiles innerHTML without a full page
reload."""
sessions = imaging_status.list_sessions()
if request.args.get("all") != "1":
sessions, _hidden = imaging_status.hide_stale(sessions)
return render_template("_imaging_tiles.html", sessions=sessions)
@@ -1179,6 +1190,12 @@ def enrollment_download(filename):
def enrollment_delete(filename):
filename = secure_filename(filename)
fpath = os.path.join(config.ENROLLMENT_PPKG_DIR, filename)
active = read_ppkg_conf().get("SOURCE_PPKG", "")
if active and filename.lower() == active.lower():
# startnet.cmd would keep pointing at a file that no longer exists.
flash(f"{filename} is the active package. Upload or activate another one before deleting it.",
"danger")
return redirect(url_for("enrollment"))
if os.path.isfile(fpath):
os.remove(fpath)
audit("ENROLLMENT_DELETE", filename)