From 9c53825afb6047d38a8be745bd8fdc08a9c49910 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 29 Oct 2008 19:11:54 +0000 Subject: [PATCH] * luci-0.8: backport statistics fixes --- .../controller/luci_statistics/luci_statistics.lua | 10 +++++++--- .../luci-statistics/luasrc/i18n/statistics.de.lua | 4 ++++ .../luci-statistics/luasrc/i18n/statistics.de.xml | 4 ++++ .../luci-statistics/luasrc/i18n/statistics.en.lua | 6 +++++- .../luci-statistics/luasrc/i18n/statistics.en.xml | 6 +++++- .../luasrc/model/cbi/luci_statistics/dns.lua | 8 +++++--- 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua index 7ca8a5aa37..0aa66362bd 100644 --- a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua +++ b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua @@ -50,8 +50,12 @@ function index() } -- create toplevel menu nodes - entry({"admin", "statistics"}, call("statistics_index"), _i18n("statistics"), 80).i18n = "statistics" - entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _i18n("collectd"), 10) + local st = entry({"admin", "statistics"}, call("statistics_index"), _i18n("statistics"), 80) + st.i18n = "statistics" + st.index = true + + entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _i18n("collectd"), 10).subindex = true + -- populate collectd plugin menu local index = 1 @@ -61,7 +65,7 @@ function index() call( "statistics_" .. section .. "plugins" ), _i18n( section .. "plugins" ), index * 10 - ) + ).index = true for j, plugin in luci.util.vspairs( plugins ) do _entry( diff --git a/applications/luci-statistics/luasrc/i18n/statistics.de.lua b/applications/luci-statistics/luasrc/i18n/statistics.de.lua index 11d94322e5..1e2e1f1a2b 100644 --- a/applications/luci-statistics/luasrc/i18n/statistics.de.lua +++ b/applications/luci-statistics/luasrc/i18n/statistics.de.lua @@ -22,6 +22,9 @@ stat_rrdtool = 'RRDTool' stat_network = 'Netzwerk' stat_csv = 'CSV Ausgabe' stat_load = 'Systemlast' +stat_dns = 'DNS' +stat_email = 'Email' +stat_unixsock = 'UnixSock' lucistatistics = 'Statistiken' lucistatistics_collectd = 'Collectd Einstellungen' lucistatistics_collectd_desc = 'Collectd ist ein schlankes Dienstprogramm zum Sammeln von Systemdaten aus verschiedenen Quellen mittels diverser Plugins. Auf dieser Seite können generelle Einstellungen für den Collectd-Daemon vorgenommen werden.' @@ -137,6 +140,7 @@ lucistatistics_collectdnetlink_classes = 'Shapingklassen überwachen' lucistatistics_collectdnetlink_classes_desc = 'Strg gedrückt halten um mehrere zu wählen' lucistatistics_collectdnetlink_filters = 'Filterklassen überwachen' lucistatistics_collectdnetlink_filters_desc = 'Strg gedrückt halten um mehrere zu wählen' +lucistatistics_collectdnetlink_ignoreselected = 'Alle außer Ausgewählte überwachen' lucistatistics_collectdnetwork = 'Network Plugin Konfiguration' lucistatistics_collectdnetwork_desc = 'Das Network-Plugin ermöglicht die netzwerkgestützte Kommunikation zwischen verschiedenen Collectd-Instanzen. Collectd kann gleichzeitig im Server- und Client-Modus betrieben werden. Im Client-Modus werden lokal gesammelte Daten an einen Collectd-Server übermittelt, im Server-Modus empfängt die lokale Instanz Daten von anderen Installationen.' lucistatistics_collectdnetwork_enable = 'Plugin aktivieren' diff --git a/applications/luci-statistics/luasrc/i18n/statistics.de.xml b/applications/luci-statistics/luasrc/i18n/statistics.de.xml index 1dee01c650..060bbc8ed2 100644 --- a/applications/luci-statistics/luasrc/i18n/statistics.de.xml +++ b/applications/luci-statistics/luasrc/i18n/statistics.de.xml @@ -27,6 +27,9 @@ Netzwerk CSV Ausgabe Systemlast +DNS +Email +UnixSock Statistiken @@ -168,6 +171,7 @@ Strg gedrückt halten um mehrere zu wählen Filterklassen überwachen Strg gedrückt halten um mehrere zu wählen +Alle außer Ausgewählte überwachen Network Plugin Konfiguration Das Network-Plugin ermöglicht die netzwerkgestützte Kommunikation zwischen verschiedenen Collectd-Instanzen. Collectd kann gleichzeitig im Server- und Client-Modus betrieben werden. Im Client-Modus werden lokal gesammelte Daten an einen Collectd-Server übermittelt, im Server-Modus empfängt die lokale Instanz Daten von anderen Installationen. diff --git a/applications/luci-statistics/luasrc/i18n/statistics.en.lua b/applications/luci-statistics/luasrc/i18n/statistics.en.lua index aecdba9f4e..c12b42007b 100644 --- a/applications/luci-statistics/luasrc/i18n/statistics.en.lua +++ b/applications/luci-statistics/luasrc/i18n/statistics.en.lua @@ -22,6 +22,9 @@ stat_rrdtool = 'RRDTool' stat_network = 'Network' stat_csv = 'CSV Output' stat_load = 'System Load' +stat_dns = 'DNS' +stat_email = 'Email' +stat_unixsock = 'UnixSock' lucistatistics = 'Statistics' lucistatistics_collectd = 'Collectd Settings' lucistatistics_collectd_desc = 'Collectd is a small daeomon for collecting data from various sources through different plugins. On this page you can change general settings for the collectd daemon.' @@ -65,7 +68,7 @@ lucistatistics_collectddns_enable = 'Enable this plugin' lucistatistics_collectddns_interfaces = 'Monitor interfaces' lucistatistics_collectddns_interfaces_desc = 'multiple separated by space' lucistatistics_collectddns_ignoresources = 'Ignore source addresses' -lucistatistics_collectddns_ignoresources_desc = 'multiple separated by space' +lucistatistics_collectddns_ignoresources_desc = 'hold Ctrl while clicking to select multiple interfaces' lucistatistics_collectdemail = 'E-Mail Plugin Configuration' lucistatistics_collectdemail_desc = 'The email plugin creates a unix socket which can be used to transmit email-statistics to a running collectd daemon. This plugin is primarily intended to be used in conjunction with Mail::SpamAssasin::Plugin::Collectd but can be used in other ways as well.' lucistatistics_collectdemail_enable = 'Enable this plugin' @@ -137,6 +140,7 @@ lucistatistics_collectdnetlink_classes = 'Shaping class monitoring' lucistatistics_collectdnetlink_classes_desc = 'hold Ctrl while clicking to select multiple interfaces' lucistatistics_collectdnetlink_filters = 'Filter class monitoring' lucistatistics_collectdnetlink_filters_desc = 'hold Ctrl while clicking to select multiple interfaces' +lucistatistics_collectdnetlink_ignoreselected = 'Monitor all except selected ones' lucistatistics_collectdnetwork = 'Network Plugin Configuration' lucistatistics_collectdnetwork_desc = 'The network plugin provides network based communication between different collectd instances. Collectd can operate both in client and server mode. In client mode locally collected date is transferred to a collectd server instance, in server mode the local instance receives data from other hosts.' lucistatistics_collectdnetwork_enable = 'Enable this plugin' diff --git a/applications/luci-statistics/luasrc/i18n/statistics.en.xml b/applications/luci-statistics/luasrc/i18n/statistics.en.xml index 0f84ff8e62..016e042c19 100644 --- a/applications/luci-statistics/luasrc/i18n/statistics.en.xml +++ b/applications/luci-statistics/luasrc/i18n/statistics.en.xml @@ -27,6 +27,9 @@ Network CSV Output System Load +DNS +Email +UnixSock Statistics @@ -78,7 +81,7 @@ Monitor interfaces multiple separated by space Ignore source addresses -multiple separated by space +hold Ctrl while clicking to select multiple interfaces E-Mail Plugin Configuration The email plugin creates a unix socket which can be used to transmit email-statistics to a running collectd daemon. This plugin is primarily intended to be used in conjunction with Mail::SpamAssasin::Plugin::Collectd but can be used in other ways as well. @@ -167,6 +170,7 @@ hold Ctrl while clicking to select multiple interfaces Filter class monitoring hold Ctrl while clicking to select multiple interfaces +Monitor all except selected ones Network Plugin Configuration The network plugin provides network based communication between different collectd instances. Collectd can operate both in client and server mode. In client mode locally collected date is transferred to a collectd server instance, in server mode the local instance receives data from other hosts. diff --git a/applications/luci-statistics/luasrc/model/cbi/luci_statistics/dns.lua b/applications/luci-statistics/luasrc/model/cbi/luci_statistics/dns.lua index be391a9c08..02fa4cb0b1 100644 --- a/applications/luci-statistics/luasrc/model/cbi/luci_statistics/dns.lua +++ b/applications/luci-statistics/luasrc/model/cbi/luci_statistics/dns.lua @@ -26,13 +26,15 @@ enable = s:option( Flag, "enable" ) enable.default = 0 -- collectd_dns.interfaces (Interface) -interfaces = s:option( ListValue, "Interfaces" ) +interfaces = s:option( MultiValue, "Interfaces" ) +interfaces.widget = "select" +interfaces.size = 5 interfaces:depends( "enable", 1 ) interfaces:value("any") for k, v in pairs(luci.sys.net.devices()) do - interfaces:value(v) + interfaces:value(v) end - + -- collectd_dns.ignoresources (IgnoreSource) ignoresources = s:option( Value, "IgnoreSources" ) ignoresources.default = "127.0.0.1" -- 2.30.2