From 7ec0304dea2b36b7b23a426a26b0819219bc7462 Mon Sep 17 00:00:00 2001 From: Malin Date: Tue, 5 May 2026 07:59:32 +0200 Subject: [PATCH] feat: add Validate Selected button, Alpha only and No SLD filters to beauty Browse - /api/validate/batch endpoint: HTTP-check only (no DeepSeek), accepts up to 500 domains - Validate Selected bulk button: runs validate in 500-domain chunks, shows live/dead summary - Alpha only checkbox: passes alpha_only=true to /api/domains to exclude hyphens/numbers - No SLD checkbox: passes no_sld=true to /api/domains to skip com.es / co.uk style domains - Both flags wired into loadDomains() and resetFilters() Co-Authored-By: Claude Sonnet 4.6 --- app/beauty_main.py | 20 ++++++++++++++++ app/static/beauty/index.html | 44 ++++++++++++++++++++++++++++++++---- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/app/beauty_main.py b/app/beauty_main.py index 1d82c1e..54d4aeb 100644 --- a/app/beauty_main.py +++ b/app/beauty_main.py @@ -188,6 +188,26 @@ async def validator_status(): # ── Pre-screen (shared) ─────────────────────────────────────────────────────── +@app.post("/api/validate/batch") +async def validate_batch(body: dict): + """HTTP-check only — no DeepSeek classification. Fast live/dead check for bulk selection.""" + domains_list = body.get("domains", []) + if not domains_list: + return JSONResponse({"error": "no domains provided"}, status_code=400) + if len(domains_list) > 500: + return JSONResponse({"error": "max 500 per batch"}, status_code=400) + from app.prescreener import prescreen_domains + results = await prescreen_domains(domains_list) + await save_prescreen_results(results) + counts: dict = {} + for r in results: + s = r.get("prescreen_status", "dead") + counts[s] = counts.get(s, 0) + 1 + return {"total": len(domains_list), "live": counts.get("live", 0), + "dead": counts.get("dead", 0), "parked": counts.get("parked", 0), + "redirect": counts.get("redirect", 0), "error": counts.get("error", 0)} + + @app.post("/api/prescreen/batch") async def prescreen_batch(body: dict): domains_list = body.get("domains", []) diff --git a/app/static/beauty/index.html b/app/static/beauty/index.html index 87eeb8c..3b88147 100644 --- a/app/static/beauty/index.html +++ b/app/static/beauty/index.html @@ -145,6 +145,12 @@ textarea{width:100%;resize:vertical;font-family:monospace;font-size:12px} + +