From: Jo-Philipp Wich Date: Thu, 22 May 2008 13:17:33 +0000 (+0000) Subject: * ffluci/statistics: fixes for interface, netlink, dns and email plugin cbi models X-Git-Tag: 0.8.0~1012 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f738eb786e3d30028310c7bcc447e7e7b63767e0;p=oweals%2Fluci.git * ffluci/statistics: fixes for interface, netlink, dns and email plugin cbi models --- diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/dns.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/dns.lua index 02896d8e4..ed71a55a3 100644 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/dns.lua +++ b/applications/luci-statistics/src/model/cbi/admin_statistics/dns.lua @@ -13,7 +13,7 @@ $Id$ ]]-- -require("ffluci.model.uci") +require("ffluci.sys") m = Map("luci_statistics", "DNS Plugin", @@ -30,10 +30,8 @@ enable.default = 0 interfaces = s:option( ListValue, "Interface", "Folgende Schnittstelle überwachen:" ) interfaces:depends( "enable", 1 ) interfaces:value("any") -for k, v in pairs(ffluci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - interfaces:value(k) - end +for k, v in pairs(ffluci.sys.net.devices()) do + interfaces:value(v) end -- collectd_dns.ignoresources (IgnoreSource) diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/email.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/email.lua index 49c11de11..7b259e829 100644 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/email.lua +++ b/applications/luci-statistics/src/model/cbi/admin_statistics/email.lua @@ -27,7 +27,7 @@ enable.default = 0 -- collectd_email.socketfile (SocketFile) socketfile = s:option( Value, "SocketFile", "Pfad für den Unix-Socket" ) -socketfile.default = "/var/run/collect-email.socket" +socketfile.default = "/var/run/collect-email.sock" socketfile:depends( "enable", 1 ) -- collectd_email.socketgroup (SocketGroup) diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/interface.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/interface.lua index e7e3042a9..5acd4e93c 100644 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/interface.lua +++ b/applications/luci-statistics/src/model/cbi/admin_statistics/interface.lua @@ -13,6 +13,9 @@ $Id$ ]]-- +require("ffluci.sys") + + m = Map("luci_statistics", "Interface Plugin", [[Das Interface-Plugin sammelt Informationen zum Netzwerkverkehr auf den einzelnen Schnittstellen.]]) @@ -27,10 +30,8 @@ enable.default = 0 interfaces = s:option( MultiValue, "Interfaces", "Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" ) interfaces.widget = "select" interfaces:depends( "enable", 1 ) -for k, v in pairs(ffluci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - interfaces:value(k) - end +for k, v in pairs(ffluci.sys.net.devices()) do + interfaces:value(v) end -- collectd_interface.ignoreselected (IgnoreSelected) diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua index 9e1b86d4d..478560f97 100644 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua +++ b/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua @@ -33,7 +33,7 @@ interfaces.optional = true interfaces:depends( "enable", 1 ) interfaces:value("") for i, v in ipairs(ffluci.sys.net.devices()) do - interfaces:value(v) + interfaces:value(v) end -- collectd_netlink.verboseinterfaces (VerboseInterface) @@ -43,7 +43,7 @@ verboseinterfaces.optional = true verboseinterfaces:depends( "enable", 1 ) verboseinterfaces:value("") for i, v in ipairs(ffluci.sys.net.devices()) do - verboseinterfaces:value(v) + verboseinterfaces:value(v) end -- collectd_netlink.qdiscs (QDisc)