diff --git a/webapp/app.py b/webapp/app.py index 3b13850..aeb44c7 100644 --- a/webapp/app.py +++ b/webapp/app.py @@ -373,12 +373,24 @@ def blancco_reports(): # negligible at fleet sizes). serial = "" model = "" + state = "" if ext == ".xml": try: data = blancco_report.parse(fpath) sysinfo = (data.get("hardware") or {}).get("system") or {} serial = sysinfo.get("serial", "") or "" model = sysinfo.get("model", "") or "" + # Overall erasure result: each erasure entry has its own + # 'state' (Successful / Failed / ...). If any drive failed + # the report rolls up to Failed; otherwise Successful. + erasures = data.get("erasures") or [] + states = [(e.get("state") or "").strip() for e in erasures if e.get("state")] + if not states: + state = "" + elif any(s.lower() != "successful" for s in states): + state = "Failed" + else: + state = "Successful" except Exception: pass reports.append({ @@ -388,6 +400,7 @@ def blancco_reports(): "type": ext.lstrip(".").upper() or "FILE", "serial": serial, "model": model, + "state": state, }) return render_template( "reports.html", diff --git a/webapp/templates/reports.html b/webapp/templates/reports.html index b42e5bf..7632001 100644 --- a/webapp/templates/reports.html +++ b/webapp/templates/reports.html @@ -16,30 +16,25 @@