Rework LuCI build system
[project/luci.git] / applications / luci-app-statistics / luasrc / model / cbi / luci_statistics / dns.lua
1 --[[
2
3 Luci configuration model for statistics - collectd dns 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("luci.sys")
17
18
19 m = Map("luci_statistics",
20         translate("DNS Plugin Configuration"),
21         translate(
22                 "The dns plugin collects detailled statistics about dns " ..
23                 "related traffic on selected interfaces."
24         ))
25
26 -- collectd_dns config section
27 s = m:section( NamedSection, "collectd_dns", "luci_statistics" )
28
29 -- collectd_dns.enable
30 enable = s:option( Flag, "enable", translate("Enable this plugin") )
31 enable.default = 0
32
33 -- collectd_dns.interfaces (Interface)
34 interfaces = s:option( MultiValue, "Interfaces", translate("Monitor interfaces") )
35 interfaces.widget = "select"
36 interfaces.size   = 5
37 interfaces:depends( "enable", 1 )
38 interfaces:value("any")
39 for k, v in pairs(luci.sys.net.devices()) do
40         interfaces:value(v)
41 end
42          
43 -- collectd_dns.ignoresources (IgnoreSource)
44 ignoresources = s:option( Value, "IgnoreSources", translate("Ignore source addresses") )
45 ignoresources.default = "127.0.0.1"
46 ignoresources:depends( "enable", 1 )
47
48 return m