Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update backend_structured/routes.py
Browse files
backend_structured/routes.py
CHANGED
|
@@ -1577,6 +1577,12 @@ def fetch_scan_logs(current_user, scan_id):
|
|
| 1577 |
return jsonify({"status": "error", "message": "Scan not found or access denied"}), 404
|
| 1578 |
|
| 1579 |
logs = get_scan_logs(scan_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1580 |
return jsonify({
|
| 1581 |
"status": scan.status,
|
| 1582 |
"logs": logs
|
|
|
|
| 1577 |
return jsonify({"status": "error", "message": "Scan not found or access denied"}), 404
|
| 1578 |
|
| 1579 |
logs = get_scan_logs(scan_id)
|
| 1580 |
+
if not logs:
|
| 1581 |
+
if scan.status == 'queued':
|
| 1582 |
+
logs = [f"[INFO] Target: {scan.target_url} — Scan queued. Waiting for active scan to finish..."]
|
| 1583 |
+
elif scan.status == 'scanning':
|
| 1584 |
+
logs = [f"[INFO] Target: {scan.target_url} — Audit thread active. Spawning vulnerability scanners..."]
|
| 1585 |
+
|
| 1586 |
return jsonify({
|
| 1587 |
"status": scan.status,
|
| 1588 |
"logs": logs
|