From 8c675f6a6ccd30c79fbc2d624b9ce2e6d7375d66 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 2 Oct 2009 01:34:54 +0000 Subject: modules/admin-full: only render ipv6 options if ipv6 is available --- .../luasrc/model/cbi/admin_network/ifaces.lua | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'modules/admin-full') 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 4a48e9f6d..6bee998b6 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -154,11 +154,13 @@ gw.rmempty = true bcast = s:taboption("general", Value, "bcast", translate("broadcast")) bcast:depends("proto", "static") -ip6addr = s:taboption("ipv6", Value, "ip6addr", translate("ip6address"), translate("cidr6")) -ip6addr:depends("proto", "static") +if has_ipv6 then + ip6addr = s:taboption("ipv6", Value, "ip6addr", translate("ip6address"), translate("cidr6")) + ip6addr:depends("proto", "static") -ip6gw = s:taboption("ipv6", Value, "ip6gw", translate("gateway6")) -ip6gw:depends("proto", "static") + ip6gw = s:taboption("ipv6", Value, "ip6gw", translate("gateway6")) + ip6gw:depends("proto", "static") +end dns = s:taboption("general", Value, "dns", translate("dnsserver")) dns:depends("peerdns", "") @@ -281,12 +283,14 @@ if has_pptp or has_pppd or has_pppoe or has_pppoa or has_3g then return ( AbstractValue.cfgvalue(...) or '1' ) end - ipv6 = s:taboption("general", Flag, "ipv6", translate("network_interface_ipv6") ) - ipv6:depends("proto", "ppp") - ipv6:depends("proto", "pppoa") - ipv6:depends("proto", "pppoe") - ipv6:depends("proto", "pptp") - ipv6:depends("proto", "3g") + if has_ipv6 then + ipv6 = s:taboption("general", Flag, "ipv6", translate("network_interface_ipv6") ) + ipv6:depends("proto", "ppp") + ipv6:depends("proto", "pppoa") + ipv6:depends("proto", "pppoe") + ipv6:depends("proto", "pptp") + ipv6:depends("proto", "3g") + end connect = s:taboption("general", Value, "connect", translate("network_interface_connect"), -- cgit v1.2.3