From ac9ba374d8bb0984b59906ec9733edc097c2c87d Mon Sep 17 00:00:00 2001 From: Hugo Yuan <429632952@163.com> Date: Sat, 15 Feb 2020 20:18:25 +0800 Subject: [PATCH] autocore: add online users count for x86 (#3101) --- package/lean/autocore/files/index.htm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/lean/autocore/files/index.htm b/package/lean/autocore/files/index.htm index 7d458eec3..1891b26b3 100644 --- a/package/lean/autocore/files/index.htm +++ b/package/lean/autocore/files/index.htm @@ -50,9 +50,12 @@ local eth_info = luci.sys.exec("ethinfo") + local user_info = tonumber(luci.sys.exec("cat /proc/net/arp | grep '0x2' | wc -l")) or 0 + local rv = { cpuinfo = cpu_info, ethinfo = eth_info, + userinfo = user_info, uptime = sysinfo.uptime or 0, localtime = os.date(), loadavg = sysinfo.load or { 0, 0, 0 }, @@ -652,6 +655,9 @@ if (e = document.getElementById('uptime')) e.innerHTML = String.format('%t', info.uptime); + if (e = document.getElementById('userinfo')) + e.innerHTML = info.userinfo; + if (e = document.getElementById('cpuinfo')) e.innerHTML = info.cpuinfo; @@ -759,6 +765,7 @@ <% end %> + <%:Online Users%>0 <%:Active Connections%>-