diff --git a/templates/status.html b/templates/status.html index aff7643..112a729 100644 --- a/templates/status.html +++ b/templates/status.html @@ -33,6 +33,13 @@ Connected Peers let currentSortDirection = null; const originalRowOrders = new Map(); // Store original order per table + function ipToNumber(ip) { + // Extract IP from formats like "10.9.0.132/32" or "99.92.101.230:56078" + const match = ip.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/); + if (!match) return 0; + return (parseInt(match[1]) << 24) + (parseInt(match[2]) << 16) + (parseInt(match[3]) << 8) + parseInt(match[4]); + } + function getSortValue(cell, sortType) { switch (sortType) { case 'number': @@ -43,6 +50,8 @@ Connected Peers return cell.getAttribute('data-value') === '1' ? 1 : 0; case 'date': return new Date(cell.getAttribute('data-value') || 0).getTime(); + case 'ip': + return ipToNumber(cell.textContent || ''); case 'text': default: return (cell.textContent || '').toLowerCase().trim(); @@ -164,8 +173,8 @@ Connected Peers