setTimeout(() => pop.remove(), 6000);
}
+ if (typeof alert === 'object') {
+
+ // Date & heure
+ const d = new Date(alert.timestamp || Date.now());
+ const dateStr = d.toLocaleString('fr-FR', {
+ day: '2-digit',
+ month: '2-digit',
+ year: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit'
+ });
+
+ // Level
+ const level = alert.alertLevel || alert.level || 'INFO';
+
+ // Action
+ const action = alert.action || 'HOLD';
+
+ // Prix (si présent)
+ let priceStr = '';
+ if (alert.price !== undefined) {
+ const currency = (alert.pair && alert.pair.includes('USD')) ? 'USD' : 'EUR';
+ priceStr = Number(alert.price).toLocaleString('fr-FR', {
+ style: 'currency',
+ currency: currency
+ });
+ }
+
+ // Pair + confiance
+ const pair = alert.pair || '';
+ const conf = typeof alert.confidence === 'number'
+ ? ` • confiance ${Math.round(alert.confidence * 100)}%`
+ : '';
+
+ // Badge couleur level
+ let badgeClass = 'bg-primary';
+ const lvl = level.toUpperCase();
+
+ if (lvl.includes('DANGER') || lvl.includes('CRITICAL')) badgeClass = 'bg-danger';
+ else if (lvl.includes('WARNING')) badgeClass = 'bg-warning text-dark';
+ else if (lvl.includes('INFO')) badgeClass = 'bg-info text-dark';
+
+ // Appliquer affichage formaté (remplace le texte brut)
+ li.innerHTML = `
+ <div style="display:flex; gap:8px; align-items:center; flex-wrap:wrap;">
+ <small class="text-muted">${dateStr}</small>
+ <span class="badge ${badgeClass}">${lvl}</span>
+ <strong>${action}</strong>
+ ${priceStr ? `<span style="font-weight:600;">${priceStr}</span>` : ''}
+ </div>
+ <div style="margin-top:4px; font-size:0.85rem; color:#cbd5e1;">
+ ${pair}${conf}
+ </div>
+ `;
+ }
+
+
// Préfixer pour voir les nouvelles alertes en haut
list.prepend(li);
});