Bot Discord
Déploiements
${environmentRows(snapshot.environments)}Dernières releases
${releaseList(snapshot.releases)}Relevé du . Version lisible par une machine : /api/status.
${footer(snapshot.links)}/** * Public status page, rendered on the server (M19). * * Same reasoning as the wiki: a page that needs JavaScript to say whether the * service is up is a page that reads as blank to a monitor, a crawler, or * anyone on a connection bad enough to be checking the status in the first * place. There is no script tag here, and the refresh is a meta tag. */ const escape = (text) => String(text ?? '') .replaceAll('&', '&') .replaceAll('<', '<') .replaceAll('>', '>') .replaceAll('"', '"'); const REFRESH_SECONDS = 60; const STATE_LABELS = { ok: 'Opérationnel', down: 'Hors ligne', busy: 'En cours', unknown: 'Inconnu', }; const DEPLOY_LABELS = { success: 'Déployé', failed: 'Échec', running: 'En cours', pending: 'En attente', }; function duration(ms) { const seconds = Math.floor(Number(ms) / 1000); if (!Number.isFinite(seconds) || seconds < 0) return '—'; const days = Math.floor(seconds / 86_400); const hours = Math.floor((seconds % 86_400) / 3600); const minutes = Math.floor((seconds % 3600) / 60); if (days > 0) return `${days} j ${hours} h`; if (hours > 0) return `${hours} h ${minutes} min`; if (minutes > 0) return `${minutes} min`; return `${seconds} s`; } function moment(value) { if (!value) return '—'; const date = new Date(String(value).includes('T') ? value : `${value}Z`); if (Number.isNaN(date.getTime())) return '—'; return date.toLocaleString('fr-FR', { dateStyle: 'medium', timeStyle: 'short' }); } const pill = (tone, label) => `${escape(label)}`; const tile = (label, value, hint) => `
Aucun déploiement enregistré pour l’instant.
'; } return `| Environnement | Dépôt | Version | État | Le |
|---|---|---|---|---|
| ${escape(entry.environment)} | ${entry.repository ? escape(entry.repository) : 'privé'} | ${entry.releaseTag ? `${escape(entry.releaseTag)}` : '—'} |
${pill(entry.tone, DEPLOY_LABELS[entry.status] ?? entry.status)} | ${escape(moment(entry.finishedAt))} |
Aucune release publiée pour l’instant.
'; } return `Relevé du . Version lisible par une machine : /api/status.
${footer(snapshot.links)}