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