mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update wizard for WAN IPv6 support
This commit is contained in:
parent
00f8830d44
commit
d29d25b95a
4 changed files with 47 additions and 9 deletions
|
@ -223,8 +223,10 @@ function wizard_add()
|
|||
local device_qmi = luci.http.formvalue("cbid.network.%s.device.qmi" % intf) or ""
|
||||
local device_modemmanager = luci.http.formvalue("cbid.network.%s.device.modemmanager" % intf) or ""
|
||||
local ipaddr = luci.http.formvalue("cbid.network.%s.ipaddr" % intf) or ""
|
||||
local ip6addr = luci.http.formvalue("cbid.network.%s.ip6addr" % intf) or ""
|
||||
local netmask = luci.http.formvalue("cbid.network.%s.netmask" % intf) or ""
|
||||
local gateway = luci.http.formvalue("cbid.network.%s.gateway" % intf) or ""
|
||||
local ip6gw = luci.http.formvalue("cbid.network.%s.ip6gw" % intf) or ""
|
||||
local apn = luci.http.formvalue("cbid.network.%s.apn" % intf) or ""
|
||||
local pincode = luci.http.formvalue("cbid.network.%s.pincode" % intf) or ""
|
||||
local delay = luci.http.formvalue("cbid.network.%s.delay" % intf) or ""
|
||||
|
@ -281,6 +283,13 @@ function wizard_add()
|
|||
ucic:set("network",intf,"netmask","")
|
||||
ucic:set("network",intf,"gateway","")
|
||||
end
|
||||
if ip6addr ~= "" then
|
||||
ucic:set("network",intf,"ip6addr",ip6addr)
|
||||
ucic:set("network",intf,"ip6gw",ip6gw)
|
||||
else
|
||||
ucic:set("network",intf,"ip6addr","")
|
||||
ucic:set("network",intf,"ip6gw","")
|
||||
end
|
||||
|
||||
ucic:delete("openmptcprouter",intf,"lc")
|
||||
ucic:save("openmptcprouter")
|
||||
|
|
|
@ -147,7 +147,7 @@
|
|||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Enable IPv6%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-input-checkbox" type="checkbox" name="enableipv6" value="0" <% if uci:get("openmptcprouter","settings","disable_ipv6") == "0" then %>checked<% end %> />
|
||||
<input class="cbi-input-checkbox" type="checkbox" id="enableipv6" name="enableipv6" value="0" <% if uci:get("openmptcprouter","settings","disable_ipv6") == "0" then %>checked<% end %> />
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:You should disable IPv6 here if server doesn't provide IPv6.%>
|
||||
|
@ -580,7 +580,7 @@
|
|||
ipv6list = uci:get_list("network",ifname,"ip6addr")
|
||||
for key, value in pairs(ipv6list) do
|
||||
%>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-ipv6address" data-depends="[{"cbid.network.<%=ifname%>.proto":"static"},{"cbid.network.<%=ifname%>.type":"macvlan"}]" data-index="8">
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-ipv6address" data-index="8">
|
||||
<label class="cbi-value-title"><%:IPv6 address%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" id="cbid.network.<%=ifname%>.ip6addr" name="cbid.network.<%=ifname%>.ip6addr" class="cbi-input-text" value="<%=value%>" data-type="ip6addr">
|
||||
|
@ -592,8 +592,9 @@
|
|||
</div>
|
||||
<%
|
||||
end
|
||||
if ipv6list ~= nil and ipv6list ~= "" then
|
||||
%>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-ip6gw" data-depends="[{"cbid.network.<%=ifname%>.proto":"static"},{"cbid.network.<%=ifname%>.type":"macvlan"}]" data-index="9">
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-ip6gw" data-index="9">
|
||||
<label class="cbi-value-title"><%:IPv6 gateway%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" id="cbid.network.<%=ifname%>.ip6gw" name="cbid.network.<%=ifname%>.ip6gw" class="cbi-input-text" value="<%=uci:get("network",ifname,"ip6gw")%>" data-type="ip6addr">
|
||||
|
@ -603,6 +604,32 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
else
|
||||
%>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-ipv6address" data-depends="[{"enableipv6":"1"}]" data-index="8">
|
||||
<label class="cbi-value-title"><%:IPv6 address%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" id="cbid.network.<%=ifname%>.ip6addr" name="cbid.network.<%=ifname%>.ip6addr" class="cbi-input-text" value="" data-type="ip6addr">
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:Set an IP in the same network as the modem%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-ip6gw" data-depends="[{"enableipv6":"1"}]" data-index="9">
|
||||
<label class="cbi-value-title"><%:IPv6 gateway%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="text" id="cbid.network.<%=ifname%>.ip6gw" name="cbid.network.<%=ifname%>.ip6gw" class="cbi-input-text" value="<%=uci:get("network",ifname,"ip6gw")%>" data-type="ip6addr">
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:Set here IP of the modem%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
<div class="cbi-value" id="cbi-network-<%=ifname%>-device-ncm" data-depends="[{"cbid.network.<%=ifname%>.proto":"ncm"}]" data-index="5">
|
||||
<label class="cbi-value-title"><%:Device%></label>
|
||||
<div class="cbi-value-field">
|
||||
|
|
|
@ -984,6 +984,8 @@ function interfaces_status()
|
|||
end
|
||||
elseif uci:get("openmptcprouter","settings","vpn") == "none" then
|
||||
mArray.openmptcprouter["tun_service"] = true
|
||||
mArray.openmptcprouter["tun_state"] = "NONE"
|
||||
mArray.openmptcprouter["tun6_state"] = "NONE"
|
||||
end
|
||||
|
||||
mArray.openmptcprouter["multi_vpn"] = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue