diff options
author | Steven Barth <steven@midlink.org> | 2008-03-27 23:14:01 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-27 23:14:01 +0000 |
commit | 077db659bbcb7cee6bbc4c4dbaed9776261190a0 (patch) | |
tree | 0128ec76baf8112f2dd6538e0c5a9448cdf7d91a /src/ffluci/model/cbi | |
parent | 3f1064b91949741af53eb1d198e228f768abaea8 (diff) |
* Major CBI improvements
Diffstat (limited to 'src/ffluci/model/cbi')
-rw-r--r-- | src/ffluci/model/cbi/admin_network/ifaces.lua | 31 | ||||
-rw-r--r-- | src/ffluci/model/cbi/admin_network/ptp.lua | 31 | ||||
-rw-r--r-- | src/ffluci/model/cbi/admin_network/vlan.lua | 6 |
3 files changed, 57 insertions, 11 deletions
diff --git a/src/ffluci/model/cbi/admin_network/ifaces.lua b/src/ffluci/model/cbi/admin_network/ifaces.lua index f1d8086359..62e72462f8 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 diff --git a/src/ffluci/model/cbi/admin_network/ptp.lua b/src/ffluci/model/cbi/admin_network/ptp.lua new file mode 100644 index 0000000000..78fcf94b9e --- /dev/null +++ b/src/ffluci/model/cbi/admin_network/ptp.lua @@ -0,0 +1,31 @@ +-- ToDo: Translate, Add descriptions and help texts +m = Map("network", "Punkt-zu-Punkt Verbindungen") + +s = m:section(TypedSection, "interface") +s.addremove = true +s:depends("proto", "pppoe") +s:depends("proto", "pptp") + +p = s:option(ListValue, "proto", "Protokoll") +p:value("pppoe", "PPPoE") +p:value("pptp", "PPTP") +p.default = "pppoe" + +s:option(Value, "ifname", "Schnittstelle") + +s:option(Value, "username", "Benutzername") +s:option(Value, "password", "Passwort") + +s:option(Value, "keepalive", "Keep-Alive").optional = true + +s:option(Value, "demand", "Dial on Demand (idle time)").optional = true + +srv = s:option(Value, "server", "PPTP-Server") +srv:depends("proto", "pptp") +srv.optional = true + +mtu = s:option(Value, "mtu", "MTU") +mtu.optional = true +mtu.isinteger = true + +return m
\ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_network/vlan.lua b/src/ffluci/model/cbi/admin_network/vlan.lua index 6a01152109..3186f2d9bb 100644 --- a/src/ffluci/model/cbi/admin_network/vlan.lua +++ b/src/ffluci/model/cbi/admin_network/vlan.lua @@ -1,12 +1,10 @@ +-- ToDo: Autodetect things, maybe use MultiValue instead, Translate, Add descriptions m = Map("network", "VLAN", "Konfguriert den Switch des Routers.") s = m:section(TypedSection, "switch") --- ToDo: Autodetect things, maybe use MultiValue instead for i = 0, 15 do - local c = s:option(Value, "vlan"..i, "vlan"..i) - c.default = "5" - c.optional = true + s:option(Value, "vlan"..i, "vlan"..i).optional = true end return m
\ No newline at end of file |