applications/luci-splash: add rate limiting options for splash clients
[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:option(Value, "limit_up", "Upload-Limitierung", "Kilobit/s - limitiert die Upload-Geschwindigkeit von Clients")
10 s:option(Value, "limit_down", "Download-Limitierung", "Kilobit/s - limitiert die Download-Geschwindigkeit von Clients")
11
12 s:option(DummyValue, "_tmp", "",
13         "Bandbreitenlimitierung für Clients wird aktiviert wenn sowohl Up- als auch " ..
14         "Download-Geschwindigkeit angegeben werden. Auf 0 setzen um die Limitierung zu deaktivieren. " ..
15         "Clients in der Whitelist werden nicht limitiert.")
16
17 s = m:section(TypedSection, "iface", "Schnittstellen")
18 s.template = "cbi/tblsection"
19 s.addremove = true
20 s.anonymous = true
21
22 local uci = luci.model.uci.cursor()
23
24 zone = s:option(ListValue, "zone", "Firewallzone")
25 uci:foreach("firewall", "zone",
26         function (section)
27                 zone:value(section.name)
28         end)
29         
30 iface = s:option(ListValue, "network", "Netzwerk")
31 uci:foreach("network", "interface",
32         function (section)
33                 if section[".name"] ~= "loopback" then
34                         iface:value(section[".name"])
35                 end
36         end)
37         
38 uci:foreach("network", "alias",
39         function (section)
40                 iface:value(section[".name"])
41         end)
42
43 s = m:section(TypedSection, "whitelist", "Automatische Freigabe")
44 s.template = "cbi/tblsection"
45 s.addremove = true
46 s.anonymous = true
47 s:option(Value, "mac", "MAC-Adresse")
48
49 s = m:section(TypedSection, "blacklist", "Automatische Sperrung")
50 s.template = "cbi/tblsection"
51 s.addremove = true
52 s.anonymous = true
53 s:option(Value, "mac", "MAC-Adresse")
54         
55 return m