fix: надежное экранирование JSON в data-seg для стабильных тултипов аптайма
Build and deploy / build-deploy (push) Has been cancelled

This commit is contained in:
2026-10-22 09:27:49 +00:00
parent 853e68aac1
commit 2d6000d1e4
+2 -1
View File
@@ -311,7 +311,8 @@ function uptimeCell(pct, history) {
const segs = hist.map((h, i) => {
const ok = typeof h === 'boolean' ? h : h && h.ok;
const data = typeof h === 'boolean' ? { ok } : h;
return `<span class="uptime-seg ${ok ? 'ok' : 'fail'}" data-seg='${JSON.stringify(data).replace(/'/g, "&#39;")}'></span>`;
const jsonStr = JSON.stringify(data).replace(/"/g, '&quot;').replace(/'/g, '&#39;');
return `<span class="uptime-seg ${ok ? 'ok' : 'fail'}" data-seg='${jsonStr}'></span>`;
}).join('');
const label = pct === null || pct === undefined ? '—' : `${pct}%`;