dns.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. require("luci.sys")
  4. m = Map("luci_statistics",
  5. translate("DNS Plugin Configuration"),
  6. translate(
  7. "The dns plugin collects detailled statistics about dns " ..
  8. "related traffic on selected interfaces."
  9. ))
  10. -- collectd_dns config section
  11. s = m:section( NamedSection, "collectd_dns", "luci_statistics" )
  12. -- collectd_dns.enable
  13. enable = s:option( Flag, "enable", translate("Enable this plugin") )
  14. enable.default = 0
  15. -- collectd_dns.interfaces (Interface)
  16. interfaces = s:option( MultiValue, "Interfaces", translate("Monitor interfaces") )
  17. interfaces.widget = "select"
  18. interfaces.size = 5
  19. interfaces:depends( "enable", 1 )
  20. interfaces:value("any")
  21. for k, v in pairs(luci.sys.net.devices()) do
  22. interfaces:value(v)
  23. end
  24. -- collectd_dns.ignoresources (IgnoreSource)
  25. ignoresources = s:option( Value, "IgnoreSources", translate("Ignore source addresses") )
  26. ignoresources.default = "127.0.0.1"
  27. ignoresources:depends( "enable", 1 )
  28. return m