Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update backend/routes.py
Browse files- backend/routes.py +3 -4
backend/routes.py
CHANGED
|
@@ -1786,11 +1786,10 @@ def fetch_scan_logs(current_user, scan_id):
|
|
| 1786 |
return jsonify({"status": "error", "message": "Scan not found or access denied"}), 404
|
| 1787 |
|
| 1788 |
logs = get_scan_logs(scan_id)
|
|
|
|
| 1789 |
if not logs:
|
| 1790 |
-
if scan.status
|
| 1791 |
-
logs = [f"[INFO]
|
| 1792 |
-
elif scan.status == 'scanning':
|
| 1793 |
-
logs = [f"[INFO] Target: {scan.target_url} — Audit thread active. Spawning vulnerability scanners..."]
|
| 1794 |
|
| 1795 |
return jsonify({
|
| 1796 |
"status": scan.status,
|
|
|
|
| 1786 |
return jsonify({"status": "error", "message": "Scan not found or access denied"}), 404
|
| 1787 |
|
| 1788 |
logs = get_scan_logs(scan_id)
|
| 1789 |
+
# If no logs yet (scan just queued), return a minimal status line
|
| 1790 |
if not logs:
|
| 1791 |
+
if scan.status in ('queued', 'scanning'):
|
| 1792 |
+
logs = [f"[INFO] Scan {scan_id[:8]}... is {scan.status}. Logs will appear shortly..."]
|
|
|
|
|
|
|
| 1793 |
|
| 1794 |
return jsonify({
|
| 1795 |
"status": scan.status,
|