/* The chart of the registry ("registry_breakdown" in registry.html): a click on a row opens the checks behind it in the analytics dialog (analytics-dialog.js). The listener sits on the document, so it keeps working after htmx replaces the table; the filter of the list is the one the chart was built with (data-qs). */ (function () { 'use strict'; if (window.registryBreakdownBound) return; window.registryBreakdownBound = true; var HINTS = { 'Результат': 'Итог именно этой проверки. Список начинается с проваленных.', 'Тип проверки': 'https, icmp, ssh, tcp-22, tls-443 и т. д.', 'Валидатор': 'Валидатор, с которого шла egress-проверка.', 'Задержка, мс': 'Сколько заняла проверка.', 'Детали': 'Ошибка проверки, если она провалена.' }; function open(btn) { var A = window.AnalyticsDialog, box = btn.closest('#registry-breakdown'); if (!A || !box) return; var tail = (box.dataset.qs ? box.dataset.qs + '&' : '') + 'key=' + encodeURIComponent(btn.dataset.bdKey); var title = box.dataset.scope + ' · ' + btn.dataset.bdLabel; A.load('/registry/breakdown/list?' + tail, title).then(function (l) { if (!l) return; var ok = l.rows.filter(function (r) { return r[1] === 'успешно'; }).length; var hints = {}; l.columns.forEach(function (c, i) { if (HINTS[c]) hints[i] = HINTS[c]; }); A.fill({ title: title, scope: 'Срез', runLabel: box.dataset.slice, note: 'Проверки этого типа в цикле адреса среза, у адресов под текущим фильтром. Провалы сверху.', cols: l.columns, rows: l.rows, hints: hints, dist: '