PLG: Enhance IP sorting in device table for correct numeric order #1606
Some checks are pending
🐳 ⚠ docker-unsafe from next_release branch / docker_dev_unsafe (push) Waiting to run

This commit is contained in:
Jokob @NetAlertX
2026-04-12 00:33:15 +00:00
parent 51b8cf03b5
commit 309315defc

View File

@@ -156,7 +156,15 @@ function loadDeviceTable({ sql, containerSelector, tableId, wrapperHtml = null,
{
title: getString('Network_Table_IP'),
data: 'devLastIP',
width: '5%'
width: '5%',
render: function (ip, type) {
if (type === 'sort') {
// Convert each octet to a zero-padded 3-digit string for correct numeric sort
if (!ip) return '';
return ip.split('.').map(o => o.padStart(3, '0')).join('.');
}
return ip || '';
}
},
{
title: getString('Device_TableHead_Port'),