summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-06 10:41:47 +0000
committerSteven Barth <steven@midlink.org>2008-08-06 10:41:47 +0000
commit206bf7f253b8e136d0d5f375bd9b5c352462c1e6 (patch)
treefcbc965168292e29718c114402db6e329ba5769f /modules/admin-full
parente194d33c532b353cdc3602897fde7312d6e27af7 (diff)
modules/admin-full: Several user interface improvements
Diffstat (limited to 'modules/admin-full')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua14
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua9
2 files changed, 19 insertions, 4 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
index 8afe05103..b8a7dd34a 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -28,11 +28,21 @@ br = s:option(Flag, "type", translate("a_n_i_bridge"), translate("a_n_i_bridge1"
br.enabled = "bridge"
br.rmempty = true
-s:option(Value, "ifname", translate("interface")).rmempty = true
+ifname = s:option(Value, "ifname", translate("interface"))
+ifname.rmempty = true
+for i,d in ipairs(luci.sys.net.devices()) do
+ if d ~= "lo" then
+ ifname:value(d)
+ end
+end
s:option(Value, "ipaddr", translate("ipaddress"))
-s:option(Value, "netmask", translate("netmask")):depends("proto", "static")
+nm = s:option(Value, "netmask", translate("netmask"))
+nm:depends("proto", "static")
+nm:value("255.255.255.0")
+nm:value("255.255.0.0")
+nm:value("255.0.0.0")
gw = s:option(Value, "gateway", translate("gateway"))
gw:depends("proto", "static")
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua
index 565edb7fd..7fd7135ff 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua
@@ -23,7 +23,12 @@ p:value("pppoe", "PPPoE")
p:value("pptp", "PPTP")
p.default = "pppoe"
-s:option(Value, "ifname", translate("interface"))
+ifname = s:option(Value, "ifname", translate("interface"))
+for i,d in ipairs(luci.sys.net.devices()) do
+ if d ~= "lo" then
+ ifname:value(d)
+ end
+end
s:option(Value, "username", translate("username"))
s:option(Value, "password", translate("password"))
@@ -34,7 +39,7 @@ s:option(Value, "demand").optional = true
srv = s:option(Value, "server")
srv:depends("proto", "pptp")
-srv.optional = true
+srv.rmempty = true
mtu = s:option(Value, "mtu", "MTU")
mtu.optional = true