* luci/statistics: template and controller translation
This commit is contained in:
parent
3e94adc682
commit
4058aacd06
6 changed files with 71 additions and 62 deletions
|
@ -11,7 +11,7 @@ function index()
|
||||||
require("luci.statistics.datatree")
|
require("luci.statistics.datatree")
|
||||||
|
|
||||||
-- load language file
|
-- load language file
|
||||||
luci.i18n.load("statistics.en")
|
luci.i18n.load("statistics.en") -- XXX: temporary / replace with loadc()
|
||||||
|
|
||||||
-- get rrd data tree
|
-- get rrd data tree
|
||||||
local tree = luci.statistics.datatree.Instance()
|
local tree = luci.statistics.datatree.Instance()
|
||||||
|
@ -35,32 +35,32 @@ function index()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
entry({"admin", "statistics"}, call("statistics_index"), "Statistiken", 80)
|
entry({"admin", "statistics"}, call("statistics_index"), _i18n("statistics"), 80).i18n = "statistics"
|
||||||
entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), "Collectd", 10)
|
entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _i18n("collectd"), 10)
|
||||||
|
|
||||||
entry({"admin", "statistics", "output"}, call("statistics_outputplugins"), "Ausgabeplugins", 20)
|
entry({"admin", "statistics", "output"}, call("statistics_outputplugins"), _i18n("outputplugins"), 20)
|
||||||
_entry({"admin", "statistics", "output", "rrdtool"}, cbi("luci_statistics/rrdtool"), "RRDTool", 10)
|
_entry({"admin", "statistics", "output", "rrdtool"}, cbi("luci_statistics/rrdtool"), _i18n("rrdtool"), 10)
|
||||||
_entry({"admin", "statistics", "output", "network"}, cbi("luci_statistics/network"), "Netzwerk", 20)
|
_entry({"admin", "statistics", "output", "network"}, cbi("luci_statistics/network"), _i18n("network"), 20)
|
||||||
_entry({"admin", "statistics", "output", "unixsock"}, cbi("luci_statistics/unixsock"), "Unix Socket", 30)
|
_entry({"admin", "statistics", "output", "unixsock"}, cbi("luci_statistics/unixsock"), _i18n("unixsock"), 30)
|
||||||
_entry({"admin", "statistics", "output", "csv"}, cbi("luci_statistics/csv"), "CSV", 40)
|
_entry({"admin", "statistics", "output", "csv"}, cbi("luci_statistics/csv"), _i18n("csv"), 40)
|
||||||
|
|
||||||
entry({"admin", "statistics", "system"}, call("statistics_systemplugins"), "Systemplugins", 30)
|
entry({"admin", "statistics", "system"}, call("statistics_systemplugins"), _i18n("systemplugins"), 30)
|
||||||
_entry({"admin", "statistics", "system", "exec"}, cbi("luci_statistics/exec"), "Exec", 10)
|
_entry({"admin", "statistics", "system", "exec"}, cbi("luci_statistics/exec"), _i18n("exec"), 10)
|
||||||
_entry({"admin", "statistics", "system", "email"}, cbi("luci_statistics/email"), "E-Mail", 20)
|
_entry({"admin", "statistics", "system", "email"}, cbi("luci_statistics/email"), _i18n("email"), 20)
|
||||||
_entry({"admin", "statistics", "system", "cpu"}, cbi("luci_statistics/cpu"), "Prozessor", 30)
|
_entry({"admin", "statistics", "system", "cpu"}, cbi("luci_statistics/cpu"), _i18n("cpu"), 30)
|
||||||
_entry({"admin", "statistics", "system", "df"}, cbi("luci_statistics/df"), "Speicherplatz", 40)
|
_entry({"admin", "statistics", "system", "df"}, cbi("luci_statistics/df"), _i18n("df"), 40)
|
||||||
_entry({"admin", "statistics", "system", "disk"}, cbi("luci_statistics/disk"), "Datenträger", 50)
|
_entry({"admin", "statistics", "system", "disk"}, cbi("luci_statistics/disk"), _i18n("disk"), 50)
|
||||||
_entry({"admin", "statistics", "system", "irq"}, cbi("luci_statistics/irq"), "Interrupts", 60)
|
_entry({"admin", "statistics", "system", "irq"}, cbi("luci_statistics/irq"), _i18n("irq"), 60)
|
||||||
_entry({"admin", "statistics", "system", "processes"}, cbi("luci_statistics/processes"), "Prozesse", 70)
|
_entry({"admin", "statistics", "system", "processes"}, cbi("luci_statistics/processes"), _i18n("processes"), 70)
|
||||||
|
|
||||||
entry({"admin", "statistics", "network"}, call("statistics_networkplugins"), "Netzwerkplugins", 40)
|
entry({"admin", "statistics", "network"}, call("statistics_networkplugins"), _i18n("networkplugins"),40)
|
||||||
_entry({"admin", "statistics", "network", "interface"}, cbi("luci_statistics/interface"), "Schnittstellen", 10)
|
_entry({"admin", "statistics", "network", "interface"}, cbi("luci_statistics/interface"), _i18n("interface"), 10)
|
||||||
_entry({"admin", "statistics", "network", "netlink"}, cbi("luci_statistics/netlink"), "Netlink", 20)
|
_entry({"admin", "statistics", "network", "netlink"}, cbi("luci_statistics/netlink"), _i18n("netlink"), 20)
|
||||||
_entry({"admin", "statistics", "network", "iptables"}, cbi("luci_statistics/iptables"), "Firewall", 30)
|
_entry({"admin", "statistics", "network", "iptables"}, cbi("luci_statistics/iptables"), _i18n("iptables"), 30)
|
||||||
_entry({"admin", "statistics", "network", "tcpconns"}, cbi("luci_statistics/tcpconns"), "Verbindungen", 40)
|
_entry({"admin", "statistics", "network", "tcpconns"}, cbi("luci_statistics/tcpconns"), _i18n("tcpconns"), 40)
|
||||||
_entry({"admin", "statistics", "network", "ping"}, cbi("luci_statistics/ping"), "Ping", 50)
|
_entry({"admin", "statistics", "network", "ping"}, cbi("luci_statistics/ping"), _i18n("ping"), 50)
|
||||||
_entry({"admin", "statistics", "network", "dns"}, cbi("luci_statistics/dns"), "DNS", 60)
|
_entry({"admin", "statistics", "network", "dns"}, cbi("luci_statistics/dns"), _i18n("dns"), 60)
|
||||||
_entry({"admin", "statistics", "network", "wireless"}, cbi("luci_statistics/wireless"), "Drahtlos", 70)
|
_entry({"admin", "statistics", "network", "wireless"}, cbi("luci_statistics/wireless"), _i18n("wireless"), 70)
|
||||||
|
|
||||||
|
|
||||||
-- public views
|
-- public views
|
||||||
|
@ -93,37 +93,31 @@ function statistics_index()
|
||||||
end
|
end
|
||||||
|
|
||||||
function statistics_outputplugins()
|
function statistics_outputplugins()
|
||||||
plugins = {
|
local plugins = { }
|
||||||
rrdtool="RRDTool",
|
|
||||||
network="Netzwerk",
|
for i, p in ipairs({ "rrdtool", "network", "unixsock", "csv" }) do
|
||||||
unixsock="Unix Socket",
|
plugins[p] = luci.i18n.translate( "stat_" .. p, p )
|
||||||
csv="CSV"
|
end
|
||||||
}
|
|
||||||
|
|
||||||
luci.template.render("admin_statistics/outputplugins", {plugins=plugins})
|
luci.template.render("admin_statistics/outputplugins", {plugins=plugins})
|
||||||
end
|
end
|
||||||
|
|
||||||
function statistics_systemplugins()
|
function statistics_systemplugins()
|
||||||
plugins = {
|
local plugins = { }
|
||||||
exec="Exec",
|
|
||||||
email="E-Mail",
|
for i, p in ipairs({ "exec", "email", "df", "disk", "irq", "processes", "cpu" }) do
|
||||||
disk="Datenträger",
|
plugins[p] = luci.i18n.translate( "stat_" .. p, p )
|
||||||
irq="Interrupts",
|
end
|
||||||
processes="Prozesse"
|
|
||||||
}
|
|
||||||
|
|
||||||
luci.template.render("admin_statistics/systemplugins", {plugins=plugins})
|
luci.template.render("admin_statistics/systemplugins", {plugins=plugins})
|
||||||
end
|
end
|
||||||
|
|
||||||
function statistics_networkplugins()
|
function statistics_networkplugins()
|
||||||
plugins = {
|
local plugins = { }
|
||||||
interface="Schnittstellen",
|
|
||||||
netlink="Netlink",
|
for i, p in ipairs({ "interface", "netlink", "iptables", "tcpconns", "ping", "dns", "wireless" }) do
|
||||||
iptables="Firewall",
|
plugins[p] = luci.i18n.translate( "stat_" .. p, p )
|
||||||
tcpconns="Verbindungen",
|
end
|
||||||
ping="Ping",
|
|
||||||
dns="DNS"
|
|
||||||
}
|
|
||||||
|
|
||||||
luci.template.render("admin_statistics/networkplugins", {plugins=plugins})
|
luci.template.render("admin_statistics/networkplugins", {plugins=plugins})
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,10 +14,21 @@ $Id$
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- general translations
|
||||||
|
--
|
||||||
|
|
||||||
|
stat_statistics = "Statistics"
|
||||||
|
stat_systemplugins = "System plugins"
|
||||||
|
stat_networkplugins = "Network plugins"
|
||||||
|
stat_outputplugins = "Output plugins"
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- collectd plugin translations
|
-- collectd plugin translations
|
||||||
--
|
--
|
||||||
|
|
||||||
|
stat_collectd = "Collectd"
|
||||||
stat_cpu = "Processor"
|
stat_cpu = "Processor"
|
||||||
stat_ping = "Ping"
|
stat_ping = "Ping"
|
||||||
stat_iptables = "Firewall"
|
stat_iptables = "Firewall"
|
||||||
|
@ -28,11 +39,17 @@ stat_tcpconns = "TCP Connections"
|
||||||
stat_interface = "Interfaces"
|
stat_interface = "Interfaces"
|
||||||
stat_df = "Disk Space Usage"
|
stat_df = "Disk Space Usage"
|
||||||
stat_irq = "Interrupts"
|
stat_irq = "Interrupts"
|
||||||
|
stat_disk = "Disk Usage"
|
||||||
|
stat_exec = "Exec"
|
||||||
|
stat_rrdtool = "RRDTool"
|
||||||
|
stat_network = "Network"
|
||||||
|
stat_csv = "CSV Output"
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- diagram translations
|
-- diagram translations
|
||||||
--
|
--
|
||||||
|
|
||||||
stat_dg_title_wireless__signal_noise = "%H: Wireless - Signal Noise Ratio"
|
stat_dg_title_wireless__signal_noise = "%H: Wireless - Signal Noise Ratio"
|
||||||
stat_dg_label_wireless__signal_noise = "dBm"
|
stat_dg_label_wireless__signal_noise = "dBm"
|
||||||
stat_ds_signal_noise = "Noise Level"
|
stat_ds_signal_noise = "Noise Level"
|
||||||
|
@ -121,6 +138,7 @@ stat_ds_irq = "IRQ %di"
|
||||||
--
|
--
|
||||||
-- CBI translations
|
-- CBI translations
|
||||||
--
|
--
|
||||||
|
|
||||||
lucistatistics = "Statistics"
|
lucistatistics = "Statistics"
|
||||||
|
|
||||||
-- general config
|
-- general config
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<h1><%:stat Statistiken%></h1>
|
<h1><%:stat Statistics%></h1>
|
||||||
|
|
||||||
<p><%:stat_desc Die Statistiken bauen auf <a href="http://collectd.org/index.shtml">Collectd</a> auf und nutzen
|
<p><%:stat_desc The statistics package is based on<a href="http://collectd.org/index.shtml">Collectd</a>
|
||||||
<a href="http://oss.oetiker.ch/rrdtool/">RRD Tool</a> um Graphen aus den erfassten Daten zu rendern.%></p>
|
and uses <a href="http://oss.oetiker.ch/rrdtool/">RRD Tool</a> to render diagram images from collected data.%></p>
|
||||||
|
|
||||||
<%+footer%>
|
<%+footer%>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<h1><%:stat_networkplugins Netzwerkplugins%></h1>
|
<h1><%:stat_networkplugins Network plugins%></h1>
|
||||||
|
|
||||||
<p><%:stat_networkplugins_desc Netzwerkplugins sammeln Werte über offene TCP-Verbindung, allgemeines Verkehrsaufkommen
|
<p><%:stat_networkplugins_desc Network plugins are used to collect information
|
||||||
auf verschiedenen Schnittstellen, DNS-Verkehr u.v.m.%></p>
|
about open tcp connections, interface traffic, iptables rules etc.%></p>
|
||||||
|
|
||||||
<p><%:stat_networkplugins_installed Installierte Netzwerkplugins:%>
|
<p><%:stat_networkplugins_installed Installed network plugins:%>
|
||||||
<ul>
|
<ul>
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
<% for plugin, desc in pairs(plugins) do %>
|
||||||
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<h1><%:stat_outputplugins Ausgabeplugins%></h1>
|
<h1><%:stat_outputplugins Output plugins%></h1>
|
||||||
|
|
||||||
<p><%:stat_outputplugins_desc Ausgabeplugins stellen verschiedene Möglichkeiten zur Speicherung
|
<p><%:stat_outputplugins_desc Output plugins provide different possibilities to store collected data.
|
||||||
der Daten bereit. Es können auch mehrere Plugins gleichzeitig aktiviert werden um beispielsweise
|
It is possible to enable multiple plugin at one, for example to store collected data in rrd databases
|
||||||
die gesammelten Werte in RRD-Datenbanken zu sichern und zusätzlich über das Netzwerk zu versenden.%></p>
|
and to transmit the data over the network to other collectd instances.%></p>
|
||||||
|
|
||||||
<p><%:stat_outputplugins_installed Installierte Ausgabeplugins:%>
|
<p><%:stat_outputplugins_installed Installed output plugins:%>
|
||||||
<ul>
|
<ul>
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
<% for plugin, desc in pairs(plugins) do %>
|
||||||
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<h1><%:stat_systemplugins Systemplugins%></h1>
|
<h1><%:stat_systemplugins System plugins%></h1>
|
||||||
|
|
||||||
<p><%:stat_systemplugins_desc Systemplugins sammeln Werte über den aktuellen Systemzustand und den Ressourcenverbrauch
|
<p><%:stat_systemplugins_desc System plugins collecting values about system state and ressource usage on the device.:%>
|
||||||
auf dem Gerät.%></p>
|
|
||||||
|
|
||||||
<p><%:stat_systemplugins_installed Installierte Systemplugins:%>
|
|
||||||
<ul>
|
<ul>
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
<% for plugin, desc in pairs(plugins) do %>
|
||||||
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
||||||
|
|
Loading…
Reference in a new issue