1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge pull request #142 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-05-30 00:03:27 +08:00 committed by GitHub
commit 1370355f83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 56 additions and 24 deletions

View file

@ -1013,6 +1013,10 @@ function settings_add()
local disableloopdetection = luci.http.formvalue("disableloopdetection") or "0"
ucic:set("openmptcprouter","settings","disableloopdetection",disableloopdetection)
-- Enable/disable http test
local disableserverhttptest = luci.http.formvalue("disableserverhttptest") or "0"
ucic:set("openmptcprouter","settings","disableserverhttptest",disableserverhttptest)
-- Enable/disable renaming intf
local disableintfrename = luci.http.formvalue("disableintfrename") or "0"
ucic:set("openmptcprouter","settings","disableintfrename",disableintfrename)
@ -1037,6 +1041,10 @@ function settings_add()
local shadowsocksudp = luci.http.formvalue("shadowsocksudp") or "0"
ucic:set("openmptcprouter","settings","shadowsocksudp",shadowsocksudp)
-- Enable/disable nDPI
local ndpi = luci.http.formvalue("ndpi") or "1"
ucic:set("openmptcprouter","settings","ndpi",ndpi)
-- Enable/disable fast open
local disablefastopen = luci.http.formvalue("disablefastopen") or "0"
if disablefastopen == "0" then

View file

@ -331,6 +331,16 @@
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable nDPI%></label>
<div class="cbi-value-field">
<input type="checkbox" name="ndpi" class="cbi-input-checkbox" value="0" <% if luci.model.uci.cursor():get("openmptcprouter","settings","ndpi") == "0" then %>checked<% end %>>
<br />
<div class="cbi-value-description">
<%:Disable nDPI, used for protocols in OMR-ByPass%>
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable ModemManager%></label>
<div class="cbi-value-field">

View file

@ -971,7 +971,7 @@
<select class="cbi-section-create-name" name="add_interface_ifname">
<%
for _, ifacea in ipairs(ifaces) do
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*")) and device_notvirtual(ifacea) then
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or iface == "bond0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*")) and device_notvirtual(ifacea) then
%>
<option value="<%=ifacea%>"><%=ifacea%></option>
<%

View file

@ -790,12 +790,12 @@ function interfaces_status()
end
if uci:get("openmptcprouter","settings","external_check") ~= "0" and mArray.openmptcprouter["dns"] == true then
if mArray.openmptcprouter["service_addr_ip"] ~= "" and mArray.openmptcprouter["service_addr_ip"] ~= nil then
--if mArray.openmptcprouter["service_addr_ip"] ~= "" and mArray.openmptcprouter["service_addr_ip"] ~= nil then
mArray.openmptcprouter["wan_addr"] = ut.trim(sys.exec("curl -4 -s -m " .. timeout .. " " .. check_ipv4_website))
if mArray.openmptcprouter["wan_addr"] == "" then
mArray.openmptcprouter["wan_addr"] = ut.trim(sys.exec("dig -4 TXT +timeout=" .. timeout .. " +tries=1 +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{print $2}'"))
end
end
--end
if mArray.openmptcprouter["ipv6"] == "enabled" or ( mArray.openmptcprouter["service_addr_ip6"] ~= "" and mArray.openmptcprouter["service_addr_ip6"] ~= nil) then
mArray.openmptcprouter["wan_addr6"] = uci:get("openmptcprouter","omr","public_detected_ipv6") or ""
if mArray.openmptcprouter["wan_addr6"] == "" then
@ -1550,6 +1550,9 @@ function interfaces_status()
table.insert(mArray.wans, data);
end
end)
if next(mArray.wans) == nil then
mArray.openmptcprouter["direct_output"] = true
end
--luci.http.prepare_content("application/json")
--luci.http.write_json(mArray)