luci-mod-admin-full: dispatch SimpleForm models using the form() action
[project/luci.git] / modules / luci-mod-admin-full / luasrc / controller / admin / status.lua
index ad575e0..4471fd5 100644 (file)
@@ -14,7 +14,7 @@ function index()
        entry({"admin", "status", "routes"}, template("admin_status/routes"), _("Routes"), 3)
        entry({"admin", "status", "syslog"}, call("action_syslog"), _("System Log"), 4)
        entry({"admin", "status", "dmesg"}, call("action_dmesg"), _("Kernel Log"), 5)
-       entry({"admin", "status", "processes"}, cbi("admin_status/processes"), _("Processes"), 6)
+       entry({"admin", "status", "processes"}, form("admin_status/processes"), _("Processes"), 6)
 
        entry({"admin", "status", "realtime"}, alias("admin", "status", "realtime", "load"), _("Realtime Graphs"), 7)
 
@@ -62,7 +62,9 @@ end
 function action_bandwidth(iface)
        luci.http.prepare_content("application/json")
 
-       local bwc = io.popen("luci-bwc -i %q 2>/dev/null" % iface)
+       local bwc = io.popen("luci-bwc -i %s 2>/dev/null"
+               % luci.util.shellquote(iface))
+
        if bwc then
                luci.http.write("[")
 
@@ -80,7 +82,9 @@ end
 function action_wireless(iface)
        luci.http.prepare_content("application/json")
 
-       local bwc = io.popen("luci-bwc -r %q 2>/dev/null" % iface)
+       local bwc = io.popen("luci-bwc -r %s 2>/dev/null"
+               % luci.util.shellquote(iface))
+
        if bwc then
                luci.http.write("[")
 
@@ -139,14 +143,12 @@ function action_connections()
 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
+       local util = require "luci.util"
 
        luci.http.prepare_content("application/json")
-       luci.http.write_json(rv)
+       luci.http.write_json(util.ubus("network.rrdns", "lookup", {
+               addrs = { ... },
+               timeout = 5000,
+               limit = 1000
+       }) or { })
 end