applications/luci-statistics: remove plugin overview pages, jump to first plugin of each category instead
This commit is contained in:
parent
00a2d24d28
commit
b39ea9e637
4 changed files with 4 additions and 147 deletions
|
@ -48,6 +48,7 @@ function index()
|
||||||
interface = _("Interfaces"),
|
interface = _("Interfaces"),
|
||||||
iptables = _("Firewall"),
|
iptables = _("Firewall"),
|
||||||
irq = _("Interrupts"),
|
irq = _("Interrupts"),
|
||||||
|
iwinfo = _("Wireless"),
|
||||||
load = _("System Load"),
|
load = _("System Load"),
|
||||||
memory = _("Memory"),
|
memory = _("Memory"),
|
||||||
netlink = _("Netlink"),
|
netlink = _("Netlink"),
|
||||||
|
@ -65,7 +66,7 @@ function index()
|
||||||
local collectd_menu = {
|
local collectd_menu = {
|
||||||
output = { "csv", "network", "rrdtool", "unixsock" },
|
output = { "csv", "network", "rrdtool", "unixsock" },
|
||||||
system = { "cpu", "df", "disk", "email", "exec", "irq", "load", "memory", "processes" },
|
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", "wireless", "iwinfo" }
|
||||||
}
|
}
|
||||||
|
|
||||||
-- create toplevel menu nodes
|
-- create toplevel menu nodes
|
||||||
|
@ -81,8 +82,7 @@ function index()
|
||||||
for section, plugins in luci.util.kspairs( collectd_menu ) do
|
for section, plugins in luci.util.kspairs( collectd_menu ) do
|
||||||
local e = entry(
|
local e = entry(
|
||||||
{ "admin", "statistics", "collectd", section },
|
{ "admin", "statistics", "collectd", section },
|
||||||
call( "statistics_" .. section .. "plugins" ),
|
firstchild(), labels["s_"..section], index * 10
|
||||||
labels["s_"..section], index * 10
|
|
||||||
)
|
)
|
||||||
|
|
||||||
e.index = true
|
e.index = true
|
||||||
|
@ -116,7 +116,7 @@ function index()
|
||||||
-- plugin menu entry
|
-- plugin menu entry
|
||||||
entry(
|
entry(
|
||||||
{ "admin", "statistics", "graph", plugin },
|
{ "admin", "statistics", "graph", plugin },
|
||||||
call("statistics_render"), labels[plugin], i
|
template("admin_statistics/index"), labels[plugin], i
|
||||||
).query = { timespan = span }
|
).query = { timespan = span }
|
||||||
|
|
||||||
-- if more then one instance is found then generate submenu
|
-- if more then one instance is found then generate submenu
|
||||||
|
@ -132,55 +132,6 @@ function index()
|
||||||
end
|
end
|
||||||
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()
|
function statistics_render()
|
||||||
|
|
||||||
require("luci.statistics.rrdtool")
|
require("luci.statistics.rrdtool")
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
<%#
|
|
||||||
LuCI - Lua Configuration Interface
|
|
||||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
|
||||||
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
-%>
|
|
||||||
<%+header%>
|
|
||||||
|
|
||||||
<h2><a id="content" name="content"><%:Network plugins%></a></h2>
|
|
||||||
|
|
||||||
<p><%:Network plugins are used to collect information
|
|
||||||
about open tcp connections, interface traffic, iptables rules etc.%></p>
|
|
||||||
|
|
||||||
<p><%:Installed network plugins:%>
|
|
||||||
<ul>
|
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
|
||||||
<% if nixio.fs.access("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
|
||||||
<li><a href="<%=controller%>/admin/statistics/collectd/network/<%=plugin%>"><%=desc%></a></li>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<%+footer%>
|
|
|
@ -1,33 +0,0 @@
|
||||||
<%#
|
|
||||||
LuCI - Lua Configuration Interface
|
|
||||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
|
||||||
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
-%>
|
|
||||||
<%+header%>
|
|
||||||
|
|
||||||
<h2><a id="content" name="content"><%:Output plugins%></a></h2>
|
|
||||||
|
|
||||||
<p><%:Output plugins provide different possibilities to store collected data.
|
|
||||||
It is possible to enable multiple plugin at one, for example to store collected data in rrd databases
|
|
||||||
and to transmit the data over the network to other collectd instances.%></p>
|
|
||||||
|
|
||||||
<p><%:Installed output plugins:%>
|
|
||||||
<ul>
|
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
|
||||||
<% if nixio.fs.access("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
|
||||||
<li><a href="<%=controller%>/admin/statistics/collectd/output/<%=plugin%>"><%=desc%></a></li>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<%+footer%>
|
|
|
@ -1,29 +0,0 @@
|
||||||
<%#
|
|
||||||
LuCI - Lua Configuration Interface
|
|
||||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
|
||||||
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
-%>
|
|
||||||
<%+header%>
|
|
||||||
|
|
||||||
<h2><a id="content" name="content"><%:System plugins%></a></h2>
|
|
||||||
|
|
||||||
<p><%:System plugins collecting values about system state and ressource usage on the device.:%>
|
|
||||||
<ul>
|
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
|
||||||
<% if nixio.fs.access("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
|
||||||
<li><a href="<%=controller%>/admin/statistics/collectd/system/<%=plugin%>"><%=desc%></a></li>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<%+footer%>
|
|
Loading…
Reference in a new issue