remove .i18n annotations from controller files
[project/luci.git] / applications / luci-splash / luasrc / model / cbi / splash / splash.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8         http://www.apache.org/licenses/LICENSE-2.0
9 ]]--
10
11 require("luci.model.uci")
12
13 m = Map("luci_splash", translate("Client-Splash"), translate("Client-Splash is a hotspot authentification system for wireless mesh networks."))
14
15 s = m:section(NamedSection, "general", "core", translate("General"))
16 s.addremove = false
17
18 s:option(Value, "leasetime", translate("Clearance time"), translate("Clients that have accepted the splash are allowed to use the network for that many hours."))
19
20 s:option(Value, "limit_up", translate("Upload limit"), translate("Clients upload speed is limited to this value (kbyte/s)"))
21 s:option(Value, "limit_down", translate("Download limit"), translate("Clients download speed is limited to this value (kbyte/s)"))
22
23 s:option(DummyValue, "_tmp", "",
24         translate("Bandwidth limit for clients is only activated when both up- and download limit are set. " ..
25         "Use a value of 0 here to completely disable this limitation. Whitelisted clients are not limited."))
26
27 s = m:section(TypedSection, "iface", translate("Interfaces"), translate("Interfaces that are used for Splash."))
28
29 s.template = "cbi/tblsection"
30 s.addremove = true
31 s.anonymous = true
32
33 local uci = luci.model.uci.cursor()
34
35 zone = s:option(ListValue, "zone", translate("Firewall zone"),
36         translate("Splash rules are integrated in this firewall zone"))
37
38 uci:foreach("firewall", "zone",
39         function (section)
40                 zone:value(section.name)
41         end)
42         
43 iface = s:option(ListValue, "network", translate("Network"),
44         translate("Intercept client traffic on this Interface"))
45
46 uci:foreach("network", "interface",
47         function (section)
48                 if section[".name"] ~= "loopback" then
49                         iface:value(section[".name"])
50                 end
51         end)
52         
53 uci:foreach("network", "alias",
54         function (section)
55                 iface:value(section[".name"])
56         end)
57
58
59 s = m:section(TypedSection, "whitelist", translate("Whitelist"),
60         translate("MAC addresses of whitelisted clients. These do not need to accept the splash and are not bandwidth limited."))
61
62 s.template = "cbi/tblsection"
63 s.addremove = true
64 s.anonymous = true
65 s:option(Value, "mac", translate ("MAC Address"))
66
67
68 s = m:section(TypedSection, "blacklist", translate("Blacklist"),
69         translate("MAC addresses in this list are blocked."))
70
71 s.template = "cbi/tblsection"
72 s.addremove = true
73 s.anonymous = true
74 s:option(Value, "mac", translate ("MAC Address"))
75
76 s = m:section(TypedSection, "subnet", translate("Allowed hosts/subnets"),
77         translate("Hosts and Networks that are listed here are excluded from splashing, i.e. they are always allowed."))
78
79 s.template = "cbi/tblsection"
80 s.addremove = true
81 s.anonymous = true
82 s:option(Value, "ipaddr", translate("IP Address"))
83 s:option(Value, "netmask", translate("Netmask"), translate("optional when using host addresses")).rmempty = true
84         
85 return m