X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-statistics%2Fluasrc%2Fcontroller%2Fluci_statistics%2Fluci_statistics.lua;h=1bc0714de809c2f3b24122b0f2f2ffa80dba3752;hp=5729bb186a1591fec614f6eb16f0cebb13b29b53;hb=5bf636732efab13fdd92dabfd746cafb156dd4f6;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 diff --git a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua index 5729bb186..1bc0714de 100644 --- a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua +++ b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua @@ -1,16 +1,6 @@ ---[[ - -Luci statistics - statistics controller module -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich -(c) 2012 Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -]]-- +-- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich +-- Copyright 2012 Jo-Philipp Wich +-- Licensed to the public under the Apache License 2.0. module("luci.controller.luci_statistics.luci_statistics", package.seeall) @@ -30,16 +20,19 @@ function index() local labels = { s_output = _("Output plugins"), - s_system = _("System plugins"), + s_general = _("General plugins"), s_network = _("Network plugins"), conntrack = _("Conntrack"), + contextswitch = _("Context Switches"), cpu = _("Processor"), + cpufreq = _("CPU Frequency"), csv = _("CSV Output"), df = _("Disk Space Usage"), disk = _("Disk Usage"), dns = _("DNS"), email = _("Email"), + entropy = _("Entropy"), exec = _("Exec"), interface = _("Interfaces"), iptables = _("Firewall"), @@ -51,11 +44,14 @@ function index() network = _("Network"), nut = _("UPS"), olsrd = _("OLSRd"), + openvpn = _("OpenVPN"), ping = _("Ping"), processes = _("Processes"), rrdtool = _("RRDTool"), + sensors = _("Sensors"), splash_leases = _("Splash Leases"), tcpconns = _("TCP Connections"), + thermal = _("Thermal"), unixsock = _("UnixSock"), uptime = _("Uptime") } @@ -63,15 +59,19 @@ function index() -- our collectd menu local collectd_menu = { output = { "csv", "network", "rrdtool", "unixsock" }, - system = { "cpu", "df", "disk", "email", "exec", "irq", "load", "memory", "nut", "processes", "uptime" }, - network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "splash_leases", "tcpconns", "iwinfo" } + general = { "contextswitch", "cpu", "cpufreq", "df", "disk", "email", + "entropy", "exec", "irq", "load", "memory", + "nut", "processes", "sensors", "thermal", "uptime" }, + network = { "conntrack", "dns", "interface", "iptables", + "netlink", "olsrd", "openvpn", "ping", + "splash_leases", "tcpconns", "iwinfo" } } -- create toplevel menu nodes local st = entry({"admin", "statistics"}, template("admin_statistics/index"), _("Statistics"), 80) st.index = true - entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _("Collectd"), 10).subindex = true + entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _("Setup"), 20).subindex = true -- populate collectd plugin menu @@ -96,7 +96,7 @@ function index() end -- output views - local page = entry( { "admin", "statistics", "graph" }, template("admin_statistics/index"), _("Graphs"), 80) + local page = entry( { "admin", "statistics", "graph" }, template("admin_statistics/index"), _("Graphs"), 10) page.setuser = "nobody" page.setgroup = "nogroup" @@ -160,7 +160,6 @@ function statistics_render() if png then luci.http.prepare_content("image/png") l12.pump.all(l12.source.file(png), luci.http.write) - png:close() end return end @@ -180,7 +179,7 @@ function statistics_render() if #instances == 0 then --instances = { graph.tree:plugin_instances( plugin )[1] } instances = graph.tree:plugin_instances( plugin ) - is_index = true + is_index = (#instances > 1) -- index instance requested elseif instances[1] == "-" then