UCI API changes
[project/luci.git] / applications / luci-splash / luasrc / model / cbi / splash / splash.lua
1 -- ToDo: Translate, Add descriptions and help texts
2 require("luci.model.uci")
3
4 m = Map("luci_splash", "Client-Splash", [[Client-Splash ist das Freifunk Hotspot-Authentifizierungs-System.]])
5
6 s = m:section(NamedSection, "general", "core", "Allgemein")
7 s:option(Value, "leasetime", "Freigabezeit", "h")
8
9 s = m:section(TypedSection, "iface", "Schnittstellen")
10 s.template = "cbi/tblsection"
11 s.addremove = true
12 s.anonymous = true
13
14 local uci = luci.model.uci.cursor()
15
16 zone = s:option(ListValue, "zone", "Firewallzone")
17 uci:foreach("firewall", "zone",
18         function (section)
19                 zone:value(section.name)
20         end)
21         
22 iface = s:option(ListValue, "network", "Netzwerk")
23 uci:foreach("network", "interface",
24         function (section)
25                 if section[".name"] ~= "loopback" then
26                         iface:value(section[".name"])
27                 end
28         end)
29         
30 uci:foreach("network", "alias",
31         function (section)
32                 iface:value(section[".name"])
33         end)
34
35 s = m:section(TypedSection, "whitelist", "Automatische Freigabe")
36 s.template = "cbi/tblsection"
37 s.addremove = true
38 s.anonymous = true
39 s:option(Value, "mac", "MAC-Adresse")
40
41 s = m:section(TypedSection, "blacklist", "Automatische Sperrung")
42 s.template = "cbi/tblsection"
43 s.addremove = true
44 s.anonymous = true
45 s:option(Value, "mac", "MAC-Adresse")
46         
47 return m