wshaper.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. -- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
  2. -- Licensed to the public under the Apache License 2.0.
  3. require("luci.tools.webadmin")
  4. m = Map("wshaper", translate("Wondershaper"),
  5. translate("Wondershaper shapes traffic to ensure low latencies for interactive traffic even when your " ..
  6. "internet connection is highly saturated."))
  7. s = m:section(NamedSection, "settings", "wshaper", translate("Wondershaper settings"))
  8. s.anonymous = true
  9. network = s:option(ListValue, "network", translate("Interface"))
  10. luci.tools.webadmin.cbi_add_networks(network)
  11. uplink = s:option(Value, "uplink", translate("Uplink"), translate("Upstream bandwidth in kbit/s"))
  12. uplink.optional = false
  13. uplink.datatype = "uinteger"
  14. uplink.default = "240"
  15. uplink = s:option(Value, "downlink", translate("Downlink"), translate("Downstream bandwidth in kbit/s"))
  16. uplink.optional = false
  17. uplink.datatype = "uinteger"
  18. uplink.default = "200"
  19. nopriohostsrc = s:option(DynamicList, "nopriohostsrc", translate("Low priority hosts (Source)"), translate("Host or Network in CIDR notation."))
  20. nopriohostsrc.optional = true
  21. nopriohostsrc.datatype = ipaddr
  22. nopriohostsrc.placeholder = "10.0.0.1/32"
  23. nopriohostdst = s:option(DynamicList, "nopriohostdst", translate("Low priority hosts (Destination)"), translate("Host or Network in CIDR notation."))
  24. nopriohostdst.optional = true
  25. nopriohostdst.datatype = ipaddr
  26. nopriohostdst.placeholder = "10.0.0.1/32"
  27. noprioportsrc = s:option(DynamicList, "noprioportsrc", translate("Low priority source ports"))
  28. noprioportsrc.optional = true
  29. noprioportsrc.datatype = "range(0,65535)"
  30. noprioportsrc.placeholder = "21"
  31. noprioportdst = s:option(DynamicList, "noprioportdst", translate("Low priority destination ports"))
  32. noprioportdst.optional = true
  33. noprioportdst.datatype = "range(0,65535)"
  34. noprioportdst.placeholder = "21"
  35. return m