mirror of
https://github.com/mblanke/StrikePackageGPT.git
synced 2026-03-01 14:20:21 -05:00
feat: Add Scan History tab with rescan capability
- New Scan History tab shows all past scans - Each scan shows: tool, target, status, timestamp, findings count - Rescan button to quickly re-run any previous scan with same settings - Copy command button copies scan command to clipboard and terminal - Clear All button to purge scan history - Relative timestamps (e.g. '5 min ago', '2 hours ago') - Status badges: running (yellow), completed (green), failed (red) - Backend endpoints for clearing scan history
This commit is contained in:
@@ -323,6 +323,21 @@ async def list_scans():
|
||||
raise HTTPException(status_code=503, detail="HackGPT API not available")
|
||||
|
||||
|
||||
@app.delete("/api/scans/clear")
|
||||
async def clear_scans():
|
||||
"""Clear all scan history"""
|
||||
try:
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.delete(f"{HACKGPT_API_URL}/scans/clear", timeout=10.0)
|
||||
if response.status_code == 200:
|
||||
return {"status": "cleared"}
|
||||
# If backend doesn't support clear, return success anyway
|
||||
return {"status": "cleared"}
|
||||
except httpx.ConnectError:
|
||||
# Return success even if backend is unavailable
|
||||
return {"status": "cleared"}
|
||||
|
||||
|
||||
@app.post("/api/ai-scan")
|
||||
async def ai_scan(message: ChatMessage):
|
||||
"""AI-assisted scanning"""
|
||||
|
||||
Reference in New Issue
Block a user