mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-12 05:01:27 -07:00
Merge pull request #1608 from netalertx/next_release
Some checks are pending
Some checks are pending
PLG: Enhance IP sorting in device table for correct numeric order #1606
This commit is contained in:
@@ -156,7 +156,15 @@ function loadDeviceTable({ sql, containerSelector, tableId, wrapperHtml = null,
|
|||||||
{
|
{
|
||||||
title: getString('Network_Table_IP'),
|
title: getString('Network_Table_IP'),
|
||||||
data: 'devLastIP',
|
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'),
|
title: getString('Device_TableHead_Port'),
|
||||||
|
|||||||
Reference in New Issue
Block a user