projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
luci-app-statistics: only render index view for more than one instance
[project/luci.git]
/
applications
/
luci-app-statistics
/
luasrc
/
controller
/
luci_statistics
/
luci_statistics.lua
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
dfe9230
..
d9c52ed
100644
(file)
--- 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,5
+1,5
@@
--- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <
xm@leipzig.freifunk.net
>
--- Copyright 2012 Jo-Philipp Wich <
xm@subsignal
.org>
+-- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <
jow@openwrt.org
>
+-- Copyright 2012 Jo-Philipp Wich <
jow@openwrt
.org>
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.luci_statistics.luci_statistics", package.seeall)
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.luci_statistics.luci_statistics", package.seeall)
@@
-20,7
+20,7
@@
function index()
local labels = {
s_output = _("Output plugins"),
local labels = {
s_output = _("Output plugins"),
- s_
system = _("System
plugins"),
+ s_
general = _("General
plugins"),
s_network = _("Network plugins"),
conntrack = _("Conntrack"),
s_network = _("Network plugins"),
conntrack = _("Conntrack"),
@@
-30,6
+30,7
@@
function index()
disk = _("Disk Usage"),
dns = _("DNS"),
email = _("Email"),
disk = _("Disk Usage"),
dns = _("DNS"),
email = _("Email"),
+ entropy = _("Entropy"),
exec = _("Exec"),
interface = _("Interfaces"),
iptables = _("Firewall"),
exec = _("Exec"),
interface = _("Interfaces"),
iptables = _("Firewall"),
@@
-53,7
+54,7
@@
function index()
-- our collectd menu
local collectd_menu = {
output = { "csv", "network", "rrdtool", "unixsock" },
-- our collectd menu
local collectd_menu = {
output = { "csv", "network", "rrdtool", "unixsock" },
-
system = { "cpu", "df", "disk", "email
", "exec", "irq", "load", "memory", "nut", "processes", "uptime" },
+
general = { "cpu", "df", "disk", "email", "entropy
", "exec", "irq", "load", "memory", "nut", "processes", "uptime" },
network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "splash_leases", "tcpconns", "iwinfo" }
}
network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "splash_leases", "tcpconns", "iwinfo" }
}
@@
-61,7
+62,7
@@
function index()
local st = entry({"admin", "statistics"}, template("admin_statistics/index"), _("Statistics"), 80)
st.index = true
local st = entry({"admin", "statistics"}, template("admin_statistics/index"), _("Statistics"), 80)
st.index = true
- entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _("
Collectd"), 1
0).subindex = true
+ entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _("
Setup"), 2
0).subindex = true
-- populate collectd plugin menu
-- populate collectd plugin menu
@@
-86,7
+87,7
@@
function index()
end
-- output views
end
-- output views
- local page = entry( { "admin", "statistics", "graph" }, template("admin_statistics/index"), _("Graphs"),
8
0)
+ local page = entry( { "admin", "statistics", "graph" }, template("admin_statistics/index"), _("Graphs"),
1
0)
page.setuser = "nobody"
page.setgroup = "nogroup"
page.setuser = "nobody"
page.setgroup = "nogroup"
@@
-150,7
+151,6
@@
function statistics_render()
if png then
luci.http.prepare_content("image/png")
l12.pump.all(l12.source.file(png), luci.http.write)
if png then
luci.http.prepare_content("image/png")
l12.pump.all(l12.source.file(png), luci.http.write)
- png:close()
end
return
end
end
return
end
@@
-170,7
+170,7
@@
function statistics_render()
if #instances == 0 then
--instances = { graph.tree:plugin_instances( plugin )[1] }
instances = graph.tree:plugin_instances( plugin )
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
-- index instance requested
elseif instances[1] == "-" then