modules/admin-full, modules/admin-mini: Added eyecandy ;-)
[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
20 nm = s:option(Value, "netmask", translate("netmask"))
21 nm:value("255.255.255.0")
22 nm:value("255.255.0.0")
23 nm:value("255.0.0.0")
24
25 gw = s:option(Value, "gateway", translate("gateway") .. translate("cbi_optional"))
26 gw.rmempty = true
27 dns = s:option(Value, "dns", translate("dnsserver") .. translate("cbi_optional"))
28 dns.rmempty = true
29
30
31 s = m:section(NamedSection, "wan", "interface", translate("m_n_inet"))
32 p = s:option(ListValue, "proto", translate("protocol"))
33 p:value("none", "disabled")
34 p:value("static", translate("manual", "manual"))
35 p:value("dhcp", translate("automatic", "automatic"))
36 p:value("pppoe", "PPPoE")
37 p:value("pptp", "PPTP")
38
39 ip = s:option(Value, "ipaddr", translate("ipaddress"))
40 ip:depends("proto", "static")
41
42 nm = s:option(Value, "netmask", translate("netmask"))
43 nm:depends("proto", "static")
44
45 gw = s:option(Value, "gateway", translate("gateway"))
46 gw:depends("proto", "static")
47 gw.rmempty = true
48
49 dns = s:option(Value, "dns", translate("dnsserver"))
50 dns:depends("proto", "static")
51 dns.rmempty = true
52
53 usr = s:option(Value, "username", translate("username"))
54 usr:depends("proto", "pppoe")
55 usr:depends("proto", "pptp")
56
57 pwd = s:option(Value, "password", translate("password"))
58 pwd:depends("proto", "pppoe")
59 pwd:depends("proto", "pptp")
60
61 kea = s:option(Flag, "keepalive", translate("m_n_keepalive"))
62 kea:depends("proto", "pppoe")
63 kea:depends("proto", "pptp")
64 kea.rmempty = true
65 kea.enabled = "10"
66
67
68 cod = s:option(Value, "demand", translate("m_n_dialondemand"), "s")
69 cod:depends("proto", "pppoe")
70 cod:depends("proto", "pptp")
71 cod.rmempty = true
72
73 srv = s:option(Value, "server", translate("m_n_pptp_server"))
74 srv:depends("proto", "pptp")
75 srv.rmempty = true
76
77
78
79 return m