diff options
Diffstat (limited to 'src/ffluci/model/cbi/admin_network/ifaces.lua')
-rw-r--r-- | src/ffluci/model/cbi/admin_network/ifaces.lua | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/ffluci/model/cbi/admin_network/ifaces.lua b/src/ffluci/model/cbi/admin_network/ifaces.lua index f1d808635..62e72462f 100644 --- a/src/ffluci/model/cbi/admin_network/ifaces.lua +++ b/src/ffluci/model/cbi/admin_network/ifaces.lua @@ -1,15 +1,32 @@ +-- ToDo: Translate, Add descriptions and help texts m = Map("network", "Schnittstellen") s = m:section(TypedSection, "interface") s.addremove = true +s:exclude("loopback") +s:depends("proto", "static") +s:depends("proto", "dhcp") p = s:option(ListValue, "proto", "Protokoll") -p:add_value("static", "statisch") -p:add_value("dhcp", "DHCP") -s:option(Value, "ipaddr", "IP-Adresse").optional = 1 -s:option(Value, "netmask", "Netzmaske").optional = 1 -s:option(Value, "gateway", "Gateway").optional = 1 -s:option(Value, "dns", "DNS").optional = 1 -s:option(Value, "mtu", "MTU").optional = 1 +p:value("static", "statisch") +p:value("dhcp", "DHCP") + +s:option(Value, "ifname", "Schnittstelle") + +s:option(Value, "ipaddr", "IP-Adresse") + +s:option(Value, "netmask", "Netzmaske"):depends("proto", "static") + +gw = s:option(Value, "gateway", "Gateway") +gw:depends("proto", "static") +gw.rmempty = true + +dns = s:option(Value, "dns", "DNS-Server") +dns:depends("proto", "static") +dns.optional = true + +mtu = s:option(Value, "mtu", "MTU") +mtu.optional = true +mtu.isinteger = true return m
\ No newline at end of file |