feat(admin): add SEO/GEO publication catalog with crawler stats
Memind CI / Test, build, and release guards (push) Successful in 3m38s

Expose a DB-backed catalog of all online publications with SEO, GEO, total,
and bot view counts from h5_publication_views for the memind_adm dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-12 16:41:39 +08:00
parent 6542a43495
commit fdc234e5d0
3 changed files with 372 additions and 0 deletions
+16
View File
@@ -62,6 +62,22 @@ function matchHostRule(hostname, rules = []) {
return '';
}
export function classifyReferrerHost(hostname) {
const host = normalizeHostname(hostname);
if (!host) {
return { discovery_channel: 'direct', discovery_source: 'direct' };
}
const geoSource = matchHostRule(host, GEO_HOST_RULES);
if (geoSource) {
return { discovery_channel: 'geo', discovery_source: geoSource };
}
const seoSource = matchHostRule(host, SEO_HOST_RULES);
if (seoSource) {
return { discovery_channel: 'seo', discovery_source: seoSource };
}
return { discovery_channel: 'referral', discovery_source: 'other' };
}
function normalizeDiscoveryChannel(value) {
const channel = String(value ?? '').trim().toLowerCase();
return channel === 'seo' || channel === 'geo' ? channel : '';