libs/cbi: Fixed MultiValue select widget
[project/luci.git] / modules / admin-core / luasrc / model / cbi / admin_network / ifaces.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 m = Map("network", translate("interfaces"), translate("a_n_ifaces1"))
15
16 s = m:section(TypedSection, "interface", "")
17 s.addremove = true
18 s:exclude("loopback")
19 s:depends("proto", "static")
20 s:depends("proto", "dhcp")
21
22 p = s:option(ListValue, "proto", translate("protocol"))
23 p:value("static", translate("static"))
24 p:value("dhcp", "DHCP")
25 p.default = "static"
26
27 br = s:option(Flag, "type", translate("a_n_i_bridge"), translate("a_n_i_bridge1"))
28 br.enabled = "bridge"
29 br.rmempty = true
30
31 s:option(Value, "ifname", translate("interface"))
32
33 s:option(Value, "ipaddr", translate("ipaddress"))
34
35 s:option(Value, "netmask", translate("netmask")):depends("proto", "static")
36
37 gw = s:option(Value, "gateway", translate("gateway"))
38 gw:depends("proto", "static")
39 gw.rmempty = true
40
41 dns = s:option(Value, "dns", translate("dnsserver"))
42 dns:depends("proto", "static")
43 dns.optional = true
44
45 mtu = s:option(Value, "mtu", "MTU")
46 mtu.optional = true
47 mtu.isinteger = true
48
49 mac = s:option(Value, "macaddr", translate("macaddress"))
50 mac.optional = true
51
52 return m