luci-mod-status: Remove port suffix where not applicable
authorOlli Asikainen <olli.asikainen@gmail.com>
Fri, 8 Feb 2019 14:49:04 +0000 (16:49 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 8 Apr 2019 08:18:59 +0000 (10:18 +0200)
Submitted-by: Olli Asikainen <olli.asikainen@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-status/luasrc/view/admin_status/connections.htm

index d9099aa0780930b576545ac309d2fbc662c5adc4..e3dd39d6079ba71bc3d85a2f2ef677510dbddd6d 100644 (file)
                                                        rows.push([
                                                                c.layer3.toUpperCase(),
                                                                c.layer4.toUpperCase(),
-                                                               src + ':' + c.sport,
-                                                               dst + ':' + c.dport,
+                                                               c.hasOwnProperty('sport') ? (src + ':' + c.sport) : src,
+                                                               c.hasOwnProperty('dport') ? (dst + ':' + c.dport) : dst,
                                                                '%1024.2mB (%d <%:Pkts.%>)'.format(c.bytes, c.packets)
                                                        ]);
                                                }