Files
op-packages/luci-app-accesscontrol-plus/luasrc/model/cbi/base.lua
T

48 lines
1.3 KiB
Lua

local uci = luci.model.uci.cursor()
a = Map("miaplus")
a.title = translate("Internet Access Schedule Control Plus")
a.description = translate("Access Schedule Control Description")
a.apply_on_parse = true
function a.on_apply(self)
luci.sys.call("/etc/init.d/miaplus restart >/dev/null 2>&1 &")
end
a:section(SimpleSection).template = "miaplus/miaplus_status"
t = a:section(TypedSection, "basic")
t.anonymous = true
e = t:option(Flag, "enable", translate("Enabled"))
e.rmempty = false
e = t:option(Flag, "strict", translate("Strict Mode"))
e.description = translate("Strict Mode will degrade CPU performance, but it can achieve better results")
e.rmempty = false
e = t:option(Flag, "ipv6enable", translate("IPV6 Enabled"))
e.rmempty = false
t = a:section(TypedSection, "macbind", translate("Client Rules"))
t.template = "cbi/tblsection"
t.anonymous = true
t.addremove = true
t.sortable = true
e = t:option(Flag, "enable", translate("Enabled"))
e.rmempty = false
e.default = "1"
e = t:option(Value, "macaddr", translate("MAC address (Computer Name)"))
e.rmempty = true
luci.sys.net.mac_hints(function(t,a)
e:value(t,"%s (%s)"%{t,a})
end)
e = t:option(ListValue, "template", translate("Template"))
uci:foreach("miaplus", "templates",
function(s)
e:value(s['.name'],s['title'])
end)
return a