diff --git a/public/app.js b/public/app.js index 4dddb33..4a53c7d 100644 --- a/public/app.js +++ b/public/app.js @@ -357,6 +357,9 @@ // ---------- Liste des prospects (mini CRM) ---------- const STATUS = { new: 'À contacter', sent: 'Contacté', replied: 'A répondu', client: 'Client', refused: 'Refus', bounced: 'Rejeté' }; + // Seuls les liens http(s) sont cliquables : un "javascript:" venu d'une page web scrapée ne doit jamais s'exécuter ici + const safeUrl = (u) => (/^https?:\/\//i.test(String(u || '')) ? String(u) : ''); + const fmtDay = (ts) => (ts ? new Date(ts * 1000).toLocaleDateString('fr-FR', { day: '2-digit', month: '2-digit', timeZone: 'Europe/Paris' }) : ''); async function loadProspects(d, page = 1) { @@ -367,7 +370,7 @@ const r = await api(`/api/projects/${proj.dataset.id}/prospects?${qs}`); d.dataset.page = r.page; box.innerHTML = r.rows.length ? `
| Entreprise | Ville | Score | Contacté | Statut | |
|---|---|---|---|---|---|
| ${x.website ? `${esc(x.company)}` : esc(x.company)} | + ${r.rows.map((x) => `|||||
| ${safeUrl(x.website) ? `${esc(x.company)}` : esc(x.company)} | ${esc(x.email)} | ${esc(x.city)} | ${x.score ?? ''} | ${fmtDay(x.sent_at)}${x.followup_at ? ' + relance' : ''} |