modules/admin-mini: Improvements in PPPoE/PPTP option descriptions
[project/luci.git] / modules / admin-mini / luasrc / model / cbi / mini / network.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13 $Id$
14 ]]--
15 m = Map("network", "Network")
16
17 s = m:section(NamedSection, "lan", "interface", translate("m_n_local"))
18 s:option(Value, "ipaddr", translate("ipaddress"))
19 s:option(Value, "netmask", translate("netmask"))
20 gw = s:option(Value, "gateway", translate("gateway") .. translate("cbi_optional"))
21 gw.rmempty = true
22 dns = s:option(Value, "dns", translate("dnsserver") .. translate("cbi_optional"))
23 dns.rmempty = true
24
25
26 s = m:section(NamedSection, "wan", "interface", translate("m_n_inet"))
27 p = s:option(ListValue, "proto", translate("protocol"))
28 p:value("none", "disabled")
29 p:value("static", translate("manual", "manual"))
30 p:value("dhcp", translate("automatic", "automatic"))
31 p:value("pppoe", "PPPoE")
32 p:value("pptp", "PPTP")
33
34 ip = s:option(Value, "ipaddr", translate("ipaddress"))
35 ip:depends("proto", "static")
36
37 nm = s:option(Value, "netmask", translate("netmask"))
38 nm:depends("proto", "static")
39
40 gw = s:option(Value, "gateway", translate("gateway"))
41 gw:depends("proto", "static")
42 gw.rmempty = true
43
44 dns = s:option(Value, "dns", translate("dnsserver"))
45 dns:depends("proto", "static")
46 dns.rmempty = true
47
48 usr = s:option(Value, "username", translate("username"))
49 usr:depends("proto", "pppoe")
50 usr:depends("proto", "pptp")
51
52 pwd = s:option(Value, "password", translate("password"))
53 pwd:depends("proto", "pppoe")
54 pwd:depends("proto", "pptp")
55
56 kea = s:option(Flag, "keepalive", translate("m_n_keepalive"))
57 kea:depends("proto", "pppoe")
58 kea:depends("proto", "pptp")
59 kea.rmempty = true
60 kea.enabled = "10"
61
62
63 cod = s:option(Value, "demand", translate("m_n_dialondemand"), "s")
64 cod:depends("proto", "pppoe")
65 cod:depends("proto", "pptp")
66 cod.rmempty = true
67
68 srv = s:option(Value, "server", translate("m_n_pptp_server"))
69 srv:depends("proto", "pptp")
70 srv.rmempty = true
71
72
73
74 return m