luci-mod-status: fix ordering realtime connections by traffic
authorJo-Philipp Wich <jo@mein.io>
Mon, 20 May 2024 08:07:41 +0000 (10:07 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 20 May 2024 08:07:41 +0000 (10:07 +0200)
Add raw byte values to properly order rows by transferred bytes,
regardless of the dispalyed unit.

Fixes: #7129
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-status/htdocs/luci-static/resources/view/status/connections.js

index 23ff1df53ea5e4fbfe7aff6a9817bea3726b90b4..bb5e937e36294dc81951708f925ce94e11379fa3 100644 (file)
@@ -135,7 +135,7 @@ return view.extend({
                                c.layer4.toUpperCase(),
                                '%h'.format(c.hasOwnProperty('sport') ? (src + ':' + c.sport) : src),
                                '%h'.format(c.hasOwnProperty('dport') ? (dst + ':' + c.dport) : dst),
-                               '%1024.2mB (%d %s)'.format(c.bytes, c.packets, _('Pkts.'))
+                               [ c.bytes, '%1024.2mB (%d %s)'.format(c.bytes, c.packets, _('Pkts.')) ]
                        ]);
                }