Website-Analyse: AVV als Seite, www/Apex-Domains, Abo-Check unabhängig vom Schalter, Dev-Hinweis

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-01 11:04:50 +00:00
1 parent 7ead59ff73
commit 714687fe3b
10 files changed
+267 -20

No files matched your search

+9 -2
View File
@@ -18,7 +18,8 @@ import {
ELIGIBILITY_MESSAGES,
activateAnalyse,
analyseDeps,
analyseDomains,
analyseHosts,
isDevPreview,
analyseEligibility,
deactivateAnalyse,
} from '../services/analyse.js'
@@ -41,8 +42,14 @@ const ANALYSE_ERROR = 'Die Website-Analyse konnte gerade nicht geändert werden.
async function analyseView(customerId, projectId) {
if (!config.analyse.enabled) return { comingSoon: true }
const [doc, eligibility] = await Promise.all([getFeatureDoc(customerId, projectId, 'analyse'), analyseEligibility(customerId, projectId)])
let devMode = false
if (doc?.state === 'active') {
const project = eligibility.project || (await getDocument(config.collections.websiteProjects, projectId).catch(() => null))
devMode = isDevPreview(project)
}
return {
state: doc?.state || 'off',
devMode,
accentColor: doc?.accentColor || '#111111',
eligible: eligibility.ok,
reason: eligibility.reason || null,
@@ -233,7 +240,7 @@ router.post('/analyse/heatmap-link', analyseGuard, async (req, res) => {
if (!doc?.siteKey || doc.state !== 'active') {
return res.status(409).json({ error: 'Die Website-Analyse ist für dieses Projekt nicht aktiv.' })
}
const domains = analyseDomains(project)
const domains = analyseHosts(project)
if (!domains.length) return res.status(409).json({ error: 'Keine gültige Domain' })
const host = project.liveDomain ? domains[domains.length - 1] : domains[0]
const token = analyseDeps.client.heatToken({ siteKey: doc.siteKey, path, vp })