mirror of
https://github.com/CyberMind-FR/secubox-deb.git
synced 2026-07-01 02:17:37 +00:00
Compare commits
No commits in common. "f5c7f6f6b567b67c82c09e7b936e1e4e22ce246f" and "4a8ee46c2d0c42c1b762aa71b166eb83d647a19c" have entirely different histories.
f5c7f6f6b5
...
4a8ee46c2d
|
|
@ -1,10 +1,3 @@
|
||||||
secubox-threat-analyst (1.4.6-1~bookworm1) bookworm; urgency=medium
|
|
||||||
|
|
||||||
* ui: add country flag emoji to the Top source countries list (#613) —
|
|
||||||
ISO 3166-1 alpha-2 → regional-indicator emoji before each code.
|
|
||||||
|
|
||||||
-- Gerald KERMA <devel@cybermind.fr> Tue, 16 Jun 2026 09:30:00 +0200
|
|
||||||
|
|
||||||
secubox-threat-analyst (1.4.5-1~bookworm1) bookworm; urgency=medium
|
secubox-threat-analyst (1.4.5-1~bookworm1) bookworm; urgency=medium
|
||||||
|
|
||||||
* ui: limit the Recent attacks table to 5 rows (#611), matching the Top-N
|
* ui: limit the Recent attacks table to 5 rows (#611), matching the Top-N
|
||||||
|
|
|
||||||
|
|
@ -421,21 +421,12 @@
|
||||||
for (const v of items) { if (!v) continue; counts[v] = (counts[v] || 0) + 1; }
|
for (const v of items) { if (!v) continue; counts[v] = (counts[v] || 0) + 1; }
|
||||||
return Object.entries(counts).sort((a, b) => b[1] - a[1]).slice(0, n);
|
return Object.entries(counts).sort((a, b) => b[1] - a[1]).slice(0, n);
|
||||||
}
|
}
|
||||||
// ISO 3166-1 alpha-2 → flag emoji (regional indicator symbols). #613
|
function renderTop(elId, pairs) {
|
||||||
function flagEmoji(cc) {
|
|
||||||
if (!cc || !/^[A-Za-z]{2}$/.test(cc)) return '';
|
|
||||||
const A = 0x1F1E6;
|
|
||||||
return String.fromCodePoint(A + cc.toUpperCase().charCodeAt(0) - 65,
|
|
||||||
A + cc.toUpperCase().charCodeAt(1) - 65);
|
|
||||||
}
|
|
||||||
function renderTop(elId, pairs, withFlag = false) {
|
|
||||||
const el = document.getElementById(elId);
|
const el = document.getElementById(elId);
|
||||||
if (!pairs.length) { el.innerHTML = '<li class="empty">no data</li>'; return; }
|
if (!pairs.length) { el.innerHTML = '<li class="empty">no data</li>'; return; }
|
||||||
el.innerHTML = pairs.map(([k, v]) => {
|
el.innerHTML = pairs.map(([k, v]) =>
|
||||||
const fl = withFlag ? flagEmoji(k) : '';
|
`<li><span class="k">${esc(k)}</span><span class="v">${v}</span></li>`
|
||||||
const label = fl ? `<span class="flag-emoji">${fl}</span> ${esc(k)}` : esc(k);
|
).join('');
|
||||||
return `<li><span class="k">${label}</span><span class="v">${v}</span></li>`;
|
|
||||||
}).join('');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loaders
|
// Loaders
|
||||||
|
|
@ -505,7 +496,7 @@
|
||||||
document.getElementById('s-unique-ips').textContent = ipSet.size;
|
document.getElementById('s-unique-ips').textContent = ipSet.size;
|
||||||
document.getElementById('s-countries').textContent = countrySet.size;
|
document.getElementById('s-countries').textContent = countrySet.size;
|
||||||
renderTop('top-ips', topN(ips, 5));
|
renderTop('top-ips', topN(ips, 5));
|
||||||
renderTop('top-countries', topN(countries, 5), true);
|
renderTop('top-countries', topN(countries, 5));
|
||||||
renderTop('top-types', topN(types, 5));
|
renderTop('top-types', topN(types, 5));
|
||||||
renderTop('top-targets', topN(targets, 5));
|
renderTop('top-targets', topN(targets, 5));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user