add diaposine

This commit is contained in:
Kirill
2026-06-03 13:16:57 +05:00
parent b7faf2d891
commit cc6ceac3a0
5 changed files with 320 additions and 3 deletions
+3 -3
View File
@@ -5,14 +5,14 @@ const EXCLUDED_PATHS = [
'/api/admin/notifications/telegram/webhook',
]
function normalizeIp(ip) {
export function normalizeIp(ip) {
if (ip && ip.startsWith('::ffff:')) {
return ip.slice(7)
}
return ip
}
function ipToInt(ip) {
export function ipToInt(ip) {
const parts = ip.split('.')
if (parts.length !== 4) return null
return parts.reduce((acc, octet) => {
@@ -22,7 +22,7 @@ function ipToInt(ip) {
}, 0)
}
function cidrMatch(ip, cidr) {
export function cidrMatch(ip, cidr) {
const slashIdx = cidr.indexOf('/')
if (slashIdx === -1) return false