|
94 | 94 | <div class="font-semibold"> |
95 | 95 | {{ campaign.delivered }}/{{ campaign.attempted }} |
96 | 96 | </div> |
97 | | - <div>{{ formatRate(campaign.delivery_rate) }}</div> |
| 97 | + <div>{{ getBatchProgress(campaign) }}</div> |
98 | 98 | </div> |
99 | 99 |
|
100 | 100 | <div class="p-2 rounded bg-surface-50"> |
@@ -260,11 +260,56 @@ function formatRate(value: number) { |
260 | 260 | return `${Number(value || 0).toFixed(2)}%`; |
261 | 261 | } |
262 | 262 |
|
| 263 | +function getBatchProgress(campaign: CampaignOverview): string { |
| 264 | + if (!campaign.total_batches || campaign.status === 'completed') { |
| 265 | + return formatRate(campaign.delivery_rate); |
| 266 | + } |
| 267 | +
|
| 268 | + const currentBatch = calculateCurrentBatch(campaign); |
| 269 | + const nextBatchTime = new Date(Date.now() + 10 * 60 * 1000); |
| 270 | + const timeStr = nextBatchTime.toLocaleTimeString([], { |
| 271 | + hour: '2-digit', |
| 272 | + minute: '2-digit', |
| 273 | + }); |
| 274 | +
|
| 275 | + return t('delivery_batch_progress', { |
| 276 | + current: currentBatch, |
| 277 | + total: campaign.total_batches, |
| 278 | + time: timeStr, |
| 279 | + }); |
| 280 | +} |
| 281 | +
|
263 | 282 | function formatDate(value: string) { |
264 | 283 | return new Date(value).toLocaleString(); |
265 | 284 | } |
266 | 285 |
|
267 | 286 | function deliveryTooltip(campaign: CampaignOverview) { |
| 287 | + if ( |
| 288 | + campaign.total_batches && |
| 289 | + campaign.status !== 'completed' && |
| 290 | + campaign.status !== 'failed' |
| 291 | + ) { |
| 292 | + const currentBatch = calculateCurrentBatch(campaign); |
| 293 | + const nextBatchTime = new Date(Date.now() + 10 * 60 * 1000); |
| 294 | + const timeStr = nextBatchTime.toLocaleString([], { |
| 295 | + day: '2-digit', |
| 296 | + month: '2-digit', |
| 297 | + year: 'numeric', |
| 298 | + hour: '2-digit', |
| 299 | + minute: '2-digit', |
| 300 | + }); |
| 301 | + return t('delivery_tooltip_with_batch', { |
| 302 | + delivered: campaign.delivered, |
| 303 | + attempted: campaign.attempted, |
| 304 | + hard: campaign.hard_bounced, |
| 305 | + soft: campaign.soft_bounced, |
| 306 | + other: campaign.failed_other, |
| 307 | + current: currentBatch, |
| 308 | + total: campaign.total_batches, |
| 309 | + time: timeStr, |
| 310 | + }); |
| 311 | + } |
| 312 | +
|
268 | 313 | return t('delivery_tooltip', { |
269 | 314 | delivered: campaign.delivered, |
270 | 315 | attempted: campaign.attempted, |
@@ -454,6 +499,8 @@ onBeforeUnmount(() => { |
454 | 499 | "unsubscribes": "Unsubscribes", |
455 | 500 | "recipients": "Recipients", |
456 | 501 | "delivery_tooltip": "Delivered: {delivered}/{attempted} | Hard bounces: {hard} | Soft bounces: {soft} | Other failures: {other}", |
| 502 | + "delivery_batch_progress": "Batch {current}/{total} · ~{time}", |
| 503 | + "delivery_tooltip_with_batch": "Batch {current} of {total}\nNext batch: {time}\nProcessed: {delivered}/{attempted} delivered\nHard bounces: {hard} | Soft bounces: {soft} | Other: {other}", |
457 | 504 | "opens_tooltip_enabled": "Open tracking is enabled. Open rates are indicative only and can be inflated by Apple Mail Privacy Protection (especially on iOS) and email client prefetching.", |
458 | 505 | "opens_tooltip_disabled": "Open tracking is disabled for this campaign, so opening metrics are not measured.", |
459 | 506 | "clicks_tooltip_enabled": "Click tracking is enabled. Unique clicks are counted per recipient when they click tracked links.", |
@@ -497,6 +544,8 @@ onBeforeUnmount(() => { |
497 | 544 | "unsubscribes": "Désinscriptions", |
498 | 545 | "recipients": "Destinataires", |
499 | 546 | "delivery_tooltip": "Livrés : {delivered}/{attempted} | Hard bounces : {hard} | Soft bounces : {soft} | Autres échecs : {other}", |
| 547 | + "delivery_batch_progress": "Lot {current}/{total} · ~{time}", |
| 548 | + "delivery_tooltip_with_batch": "Lot {current} sur {total}\nProchain lot : {time}\nTraités : {delivered}/{attempted} livrés\nHard bounces : {hard} | Soft bounces : {soft} | Autres : {other}", |
500 | 549 | "opens_tooltip_enabled": "Le tracking des ouvertures est activé. Le taux d'ouverture reste indicatif et peut être surestimé (Apple Mail Privacy Protection, notamment sur iOS, et préchargements des clients email).", |
501 | 550 | "opens_tooltip_disabled": "Le tracking des ouvertures est désactivé pour cette campagne, les ouvertures ne sont donc pas mesurées.", |
502 | 551 | "clicks_tooltip_enabled": "Le tracking des clics est activé. Les clics uniques sont comptés une seule fois par destinataire et par lien.", |
|
0 commit comments