From 5672b61b5ed95b28350b013b630f779d9ea3d72d Mon Sep 17 00:00:00 2001 From: Malin Date: Tue, 5 May 2026 07:49:47 +0200 Subject: [PATCH] fix: beauty Browse uses /api/domains (DuckDB) like main DomGod MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - loadDomains() now calls /api/domains (72M domain index) instead of /api/enriched - keyword and TLD filters are server-side (DuckDB); prescreen_status, niche, site_type, country are client-side — same pattern as main DomGod _fetch() - "Not checked" now correctly finds domains that exist in DuckDB but have never been pre-screened (no row in enriched_domains, so no prescreen_status) - results info shows "X shown · Y matching · page N" to reflect DuckDB total vs client-side-filtered visible count Co-Authored-By: Claude Sonnet 4.6 --- app/static/beauty/index.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/static/beauty/index.html b/app/static/beauty/index.html index 1c520c9..87eeb8c 100644 --- a/app/static/beauty/index.html +++ b/app/static/beauty/index.html @@ -153,7 +153,7 @@ textarea{width:100%;resize:vertical;font-family:monospace;font-size:12px} - + @@ -478,15 +478,18 @@ function app() { this.loading = true; try { const p = new URLSearchParams({page: this.f.page, limit: this.f.limit}); - if (this.f.keyword) p.set('keyword', this.f.keyword.trim()); - if (this.f.tld) p.set('tld', this.f.tld.trim()); - if (this.f.prescreen_status) p.set('prescreen_status', this.f.prescreen_status); - if (this.f.niche) p.set('niche', this.f.niche); - if (this.f.site_type) p.set('site_type', this.f.site_type); - if (this.f.country) p.set('country', this.f.country.trim().toUpperCase()); - const d = await fetch('/api/enriched?' + p).then(r=>r.json()); - this.domains = d.results || []; - this.domainsTotal = d.total || 0; + if (this.f.keyword) p.set('keyword', this.f.keyword.trim()); + if (this.f.tld) p.set('tld', this.f.tld.trim()); + const d = await fetch('/api/domains?' + p).then(r=>r.json()); + this.domainsTotal = d.total || 0; + let rows = d.results || []; + // Client-side filters (same pattern as main DomGod) + if (this.f.prescreen_status === 'none') rows = rows.filter(r => !r.prescreen_status); + else if (this.f.prescreen_status) rows = rows.filter(r => r.prescreen_status === this.f.prescreen_status); + if (this.f.niche) rows = rows.filter(r => r.niche === this.f.niche); + if (this.f.site_type) rows = rows.filter(r => r.site_type === this.f.site_type); + if (this.f.country) rows = rows.filter(r => r.ip_country === this.f.country.trim().toUpperCase()); + this.domains = rows; } catch(e) { this.notify('Failed to load: '+e.message, 'error'); } finally { this.loading = false; } },