From: Paul Donald Date: Fri, 24 Apr 2026 15:33:46 +0000 (+0200) Subject: luci-app-ocserv: correct JSON user data X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=4a2623038a04e8ead9b825de332b498d54e4aa78;p=openwrt-luci.git luci-app-ocserv: correct JSON user data Should help users like #8571 Signed-off-by: Paul Donald --- diff --git a/applications/luci-app-ocserv/htdocs/luci-static/resources/view/ocserv/users.js b/applications/luci-app-ocserv/htdocs/luci-static/resources/view/ocserv/users.js index d37c2c1ca6..d8477b05af 100644 --- a/applications/luci-app-ocserv/htdocs/luci-static/resources/view/ocserv/users.js +++ b/applications/luci-app-ocserv/htdocs/luci-static/resources/view/ocserv/users.js @@ -59,18 +59,18 @@ return L.view.extend({ normalizeUser(entry) { return { - id: entry.id, - user: entry?.username || entry?.user, - group: entry?.group, - vpn_ip: entry['vpn-ipv4'] || entry.vpn_ip, - vpn_ip6: entry['vpn-ipv6'] || entry.vpn_ip6, - ip: entry?.ip, - device: entry?.device, - time: entry?.time || entry['connected-at'], - cipher: entry?.cipher, - status: entry?.status, - tx: entry?._TX || entry?.TX || entry?.tx, - rx: entry?._RX || entry?.RX || entry?.rx + id: entry.ID, + user: entry?.Username || entry?.User, + group: entry?.Groupname || entry?.Group, + vpn_ip: entry['vpn-ipv4'] || entry.vpn_ip || entry?.['P-t-P IPv4'], + vpn_ip6: entry['vpn-ipv6'] || entry.vpn_ip6 || entry?.['P-t-P IPv6'], + ip: entry?.IPv4 || entry?.IPv6 || entry?.['Remote IP'], + device: entry?.Device, + time: entry?.raw_connected_at || entry['Connected at'], + cipher: entry?.Cipher || entry?.['TLS ciphersuite'], + status: entry?.Status || entry?.State, + tx: entry?._TX || entry?.TX || entry?.tx || entry?.raw_tx, + rx: entry?._RX || entry?.RX || entry?.rx || entry?.raw_rx, }; }, diff --git a/applications/luci-app-ocserv/htdocs/luci-static/resources/view/status/include/80_ocserv.js b/applications/luci-app-ocserv/htdocs/luci-static/resources/view/status/include/80_ocserv.js index 6a88657443..3585fb6ff5 100644 --- a/applications/luci-app-ocserv/htdocs/luci-static/resources/view/status/include/80_ocserv.js +++ b/applications/luci-app-ocserv/htdocs/luci-static/resources/view/status/include/80_ocserv.js @@ -46,18 +46,18 @@ return baseclass.extend({ normalizeUser: function(entry) { return { - id: entry.id, - user: entry?.username || entry?.user, - group: entry?.group, - vpn_ip: entry['vpn-ipv4'] || entry.vpn_ip, - vpn_ip6: entry['vpn-ipv6'] || entry.vpn_ip6, - ip: entry?.ip, - device: entry?.device, - time: entry?.time || entry['connected-at'], - cipher: entry?.cipher, - status: entry?.status, - tx: entry?._TX || entry?.TX || entry?.tx, - rx: entry?._RX || entry?.RX || entry?.rx + id: entry.ID, + user: entry?.Username || entry?.User, + group: entry?.Groupname || entry?.Group, + vpn_ip: entry['vpn-ipv4'] || entry.vpn_ip || entry?.['P-t-P IPv4'], + vpn_ip6: entry['vpn-ipv6'] || entry.vpn_ip6 || entry?.['P-t-P IPv6'], + ip: entry?.IPv4 || entry?.IPv6 || entry?.['Remote IP'], + device: entry?.Device, + time: entry?.raw_connected_at || entry['Connected at'], + cipher: entry?.Cipher || entry?.['TLS ciphersuite'], + status: entry?.Status || entry?.State, + tx: entry?._TX || entry?.TX || entry?.tx || entry?.raw_tx, + rx: entry?._RX || entry?.RX || entry?.rx || entry?.raw_rx, }; },