mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Better quota and tracker interface
This commit is contained in:
parent
116dae3c40
commit
82e83780eb
5 changed files with 70 additions and 10 deletions
|
@ -9,20 +9,18 @@ local ifaces = sys.net:devices()
|
|||
m = Map("omr-quota", translate("Quota"), translate("Set quota, when quota is reached interface state is set to down"))
|
||||
|
||||
s = m:section(TypedSection, "interface", translate("Interfaces"))
|
||||
s.template_addremove = "omr-quota/cbi-select-add"
|
||||
s.addremove = true
|
||||
s.anonymous = false
|
||||
s.add_select_options = { }
|
||||
for _, iface in ipairs(ifaces) do
|
||||
if not (iface == "lo" or iface:match("^ifb.*")) then
|
||||
s.add_select_options[iface] = iface
|
||||
end
|
||||
end
|
||||
|
||||
e = s:option(Flag, "enabled", translate("Enable"))
|
||||
e.rmempty = false
|
||||
|
||||
intf = s:option(ListValue, "interface", translate("Interface name"))
|
||||
for _, iface in ipairs(ifaces) do
|
||||
if not (iface == "lo" or iface:match("^ifb.*")) then
|
||||
intf:value(iface)
|
||||
end
|
||||
end
|
||||
intf.rmempty = false
|
||||
|
||||
tx = s:option(Value, "txquota", translate("TX quota (kbit)"))
|
||||
tx.datatype = "uinteger"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue