From 309315defcca32736fb80f09f7f50c159f487bf2 Mon Sep 17 00:00:00 2001 From: "Jokob @NetAlertX" <96159884+jokob-sk@users.noreply.github.com> Date: Sun, 12 Apr 2026 00:33:15 +0000 Subject: [PATCH] PLG: Enhance IP sorting in device table for correct numeric order #1606 --- front/js/network-api.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/front/js/network-api.js b/front/js/network-api.js index e1c28ffd..ab375005 100644 --- a/front/js/network-api.js +++ b/front/js/network-api.js @@ -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'),