summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/ffluci/model')
-rw-r--r--src/ffluci/model/cbi/admin_network/ifaces.lua31
-rw-r--r--src/ffluci/model/cbi/admin_network/ptp.lua31
-rw-r--r--src/ffluci/model/cbi/admin_network/vlan.lua6
-rw-r--r--src/ffluci/model/uci.lua3
4 files changed, 60 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
diff --git a/src/ffluci/model/uci.lua b/src/ffluci/model/uci.lua
index 75d34c5d6d..6585c66cb4 100644
--- a/src/ffluci/model/uci.lua
+++ b/src/ffluci/model/uci.lua
@@ -7,6 +7,9 @@ is comparable to the syntax of the uci application
Any return value of false or nil can be interpreted as an error
+
+ToDo: Reimplement in Lua
+
FileId:
$Id$