5acd4e93cab595982765c73bc6537f57d6de9bb5
[project/luci.git] / applications / luci-statistics / src / model / cbi / admin_statistics / interface.lua
1 --[[
2
3 Luci configuration model for statistics - collectd interface plugin configuration
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 ]]--
15
16 require("ffluci.sys")
17
18
19 m = Map("luci_statistics", "Interface Plugin",
20 [[Das Interface-Plugin sammelt Informationen zum Netzwerkverkehr auf den einzelnen Schnittstellen.]])
21
22 -- collectd_interface config section
23 s = m:section( NamedSection, "collectd_interface", "luci_statistics", "Pluginkonfiguration" )
24
25 -- collectd_interface.enable
26 enable = s:option( Flag, "enable", "Plugin aktivieren" )
27 enable.default = 0
28
29 -- collectd_interface.interfaces (Interface)
30 interfaces = s:option( MultiValue, "Interfaces", "Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" )
31 interfaces.widget = "select"
32 interfaces:depends( "enable", 1 )
33 for k, v in pairs(ffluci.sys.net.devices()) do
34         interfaces:value(v)
35 end
36
37 -- collectd_interface.ignoreselected (IgnoreSelected)
38 ignoreselected = s:option( Flag, "IgnoreSelected", "Alle Schnittstellen außer ausgewählte überwachen" )
39 ignoreselected.default = 0
40 ignoreselected:depends( "enable", 1 )
41
42 return m