applications/luci-statistics: fix controller (#7344)
[project/luci.git] / applications / luci-statistics / luasrc / controller / luci_statistics / luci_statistics.lua
index 87b22fc..ccea56e 100644 (file)
@@ -48,6 +48,7 @@ function index()
                interface       = _("Interfaces"),
                iptables        = _("Firewall"),
                irq                     = _("Interrupts"),
+               iwinfo          = _("Wireless"),
                load            = _("System Load"),
                memory          = _("Memory"),
                netlink         = _("Netlink"),
@@ -57,19 +58,18 @@ function index()
                processes       = _("Processes"),
                rrdtool         = _("RRDTool"),
                tcpconns        = _("TCP Connections"),
-               unixsock        = _("UnixSock"),
-               wireless        = _("Wireless")
+               unixsock        = _("UnixSock")
        }
 
        -- our collectd menu
        local collectd_menu = {
                output  = { "csv", "network", "rrdtool", "unixsock" },
                system  = { "cpu", "df", "disk", "email", "exec", "irq", "load", "memory", "processes" },
-               network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "tcpconns", "wireless" }
+               network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "tcpconns", "iwinfo" }
        }
 
        -- create toplevel menu nodes
-       local st = entry({"admin", "statistics"}, call("statistics_index"), _("Statistics"), 80)
+       local st = entry({"admin", "statistics"}, template("admin_statistics/index"), _("Statistics"), 80)
        st.i18n = "statistics"
        st.index = true
        
@@ -81,8 +81,7 @@ function index()
        for section, plugins in luci.util.kspairs( collectd_menu ) do
                local e = entry(
                        { "admin", "statistics", "collectd", section },
-                       call( "statistics_" .. section .. "plugins" ),
-                       labels["s_"..section], index * 10
+                       firstchild(), labels["s_"..section], index * 10
                )
 
                e.index = true
@@ -100,7 +99,7 @@ function index()
        end
 
        -- output views
-       local page = entry( { "admin", "statistics", "graph" }, call("statistics_index"), _("Graphs"), 80)
+       local page = entry( { "admin", "statistics", "graph" }, template("admin_statistics/index"), _("Graphs"), 80)
              page.i18n     = "statistics"
              page.setuser  = "nobody"
              page.setgroup = "nogroup"
@@ -132,55 +131,6 @@ function index()
        end
 end
 
-function statistics_index()
-       luci.template.render("admin_statistics/index")
-end
-
-function statistics_outputplugins()
-       local translate = luci.i18n.translate
-       local plugins = {
-               rrdtool         = translate("RRDTool"),
-               network         = translate("Network"),
-               unixsock        = translate("UnixSock"),
-               csv                     = translate("CSV Output")
-       }
-
-       luci.template.render("admin_statistics/outputplugins", {plugins=plugins})
-end
-
-function statistics_systemplugins()
-       local translate = luci.i18n.translate
-       local plugins = {
-               exec            = translate("Exec"),
-               email           = translate("Email"),
-               cpu                     = translate("Processor"),
-               df                      = translate("Disk Space Usage"),
-               disk            = translate("Disk Usage"),
-               irq                     = translate("Interrupts"),
-               processes       = translate("Processes"),
-               load            = translate("System Load"),
-       }
-
-       luci.template.render("admin_statistics/systemplugins", {plugins=plugins})
-end
-
-function statistics_networkplugins()
-       local translate = luci.i18n.translate
-       local plugins = {
-               interface       = translate("Interfaces"),
-               netlink         = translate("Netlink"),
-               iptables        = translate("Firewall"),
-               tcpconns        = translate("TCP Connections"),
-               ping            = translate("Ping"),
-               dns                     = translate("DNS"),
-               wireless        = translate("Wireless"),
-               olsrd           = translate("OLSRd")
-       }
-
-       luci.template.render("admin_statistics/networkplugins", {plugins=plugins})
-end
-
-
 function statistics_render()
 
        require("luci.statistics.rrdtool")