diff options
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 |