interface.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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("Interface Plugin Configuration"),
  6. translate(
  7. "The interface plugin collects traffic statistics on " ..
  8. "selected interfaces."
  9. ))
  10. -- collectd_interface config section
  11. s = m:section( NamedSection, "collectd_interface", "luci_statistics" )
  12. -- collectd_interface.enable
  13. enable = s:option( Flag, "enable", translate("Enable this plugin") )
  14. enable.default = 0
  15. -- collectd_interface.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. for k, v in pairs(luci.sys.net.devices()) do
  21. interfaces:value(v)
  22. end
  23. -- collectd_interface.ignoreselected (IgnoreSelected)
  24. ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
  25. ignoreselected.default = 0
  26. ignoreselected:depends( "enable", 1 )
  27. return m