* CBI: Generalized templates
[project/luci.git] / src / ffluci / model / cbi / admin_network / ifaces.lua
1 -- ToDo: Translate, Add descriptions and help texts
2 m = Map("network", "Schnittstellen")
3
4 s = m:section(TypedSection, "interface")
5 s.addremove = true
6 s:exclude("loopback")
7 s:depends("proto", "static")
8 s:depends("proto", "dhcp")
9
10 p = s:option(ListValue, "proto", "Protokoll")
11 p:value("static", "statisch")
12 p:value("dhcp", "DHCP")
13 p.default = "static"
14
15 s:option(Value, "ifname", "Schnittstelle")
16
17 s:option(Value, "ipaddr", "IP-Adresse")
18
19 s:option(Value, "netmask", "Netzmaske"):depends("proto", "static")
20
21 gw = s:option(Value, "gateway", "Gateway")
22 gw:depends("proto", "static")
23 gw.rmempty = true
24
25 dns = s:option(Value, "dns", "DNS-Server")
26 dns:depends("proto", "static")
27 dns.optional = true
28
29 mtu = s:option(Value, "mtu", "MTU")
30 mtu.optional = true
31 mtu.isinteger = true
32
33 return m