diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-03-04 18:36:05 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-03-04 18:36:05 +0000 |
commit | b22f022f2c3652a5af3c1ef843a9b06eba851404 (patch) | |
tree | 633a00a0d6c263974b88d6a872b6b364cd718a80 /modules/admin-full/luasrc/controller/admin/status.lua | |
parent | e6bf801bad495bc15f8272af3ae653e50421c6c6 (diff) |
modules/admin-full: add DNS resolution to connections status page, order connections descending by traffic
Diffstat (limited to 'modules/admin-full/luasrc/controller/admin/status.lua')
-rw-r--r-- | modules/admin-full/luasrc/controller/admin/status.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/status.lua b/modules/admin-full/luasrc/controller/admin/status.lua index f77d91b343..d7d301c542 100644 --- a/modules/admin-full/luasrc/controller/admin/status.lua +++ b/modules/admin-full/luasrc/controller/admin/status.lua @@ -37,6 +37,8 @@ function index() entry({"admin", "status", "realtime", "connections"}, template("admin_status/connections"), _("Connections"), 4).leaf = true entry({"admin", "status", "realtime", "connections_status"}, call("action_connections")).leaf = true + + entry({"admin", "status", "nameinfo"}, call("action_nameinfo")).leaf = true end function action_syslog() @@ -153,3 +155,16 @@ function action_connections() luci.http.write(" }") end + +function action_nameinfo(...) + local i + local rv = { } + for i = 1, select('#', ...) do + local addr = select(i, ...) + local fqdn = nixio.getnameinfo(addr) + rv[addr] = fqdn or (addr:match(":") and "[%s]" % addr or addr) + end + + luci.http.prepare_content("application/json") + luci.http.write_json(rv) +end |