luci-app-passwall: sync upstream

last commit: 7ed5fa1fc6
This commit is contained in:
gitea-action 2025-04-17 17:30:20 +08:00
parent 2ddc55693e
commit 033f758e8f
4 changed files with 27 additions and 3 deletions

View File

@ -250,6 +250,13 @@ o.validate = port_validate
o:depends({ use_global_config = true })
o:depends({ _udp_node_bool = "1" })
o = s:option(DummyValue, "tips", " ")
o.rawhtml = true
o.cfgvalue = function(t, n)
return string.format('<font color="red">%s</font>',
translate("The port settings support single ports and ranges.<br>Separate multiple ports with commas (,).<br>Example: 21,80,443,1000:2000."))
end
o = s:option(Flag, "use_direct_list", translatef("Use %s", translate("Direct List")))
o.default = "1"
o:depends({ _tcp_node_bool = "1" })

View File

@ -107,6 +107,13 @@ o:value("1:65535", translate("All"))
o:value("53", "DNS")
o.validate = port_validate
o = s:option(DummyValue, "tips", " ")
o.rawhtml = true
o.cfgvalue = function(t, n)
return string.format('<font color="red">%s</font>',
translate("The port settings support single ports and ranges.<br>Separate multiple ports with commas (,).<br>Example: 21,80,443,1000:2000."))
end
---- Use nftables
o = s:option(ListValue, "use_nft", translate("Firewall tools"))
o.default = "0"

View File

@ -709,6 +709,9 @@ msgstr "UDP 不转发端口"
msgid "Fill in the ports you don't want to be forwarded by the agent, with the highest priority."
msgstr "填写你不希望被代理转发的端口,优先级最高。"
msgid "The port settings support single ports and ranges.<br>Separate multiple ports with commas (,).<br>Example: 21,80,443,1000:2000."
msgstr "以上端口设置支持单端口和端口范围。<br>多个端口用英文逗号(,)隔开。<br>例21,80,443,1000:2000。"
msgid "TCP Proxy Drop Ports"
msgstr "TCP 转发屏蔽端口"

View File

@ -41,12 +41,19 @@ factor() {
elif echo "$1" | grep -qE '([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}'; then
echo "$2 {$1}"
else
ports=$(echo "$ports" | tr -d ' ' | sed 's/:/-/g')
if echo "$ports" | grep -qE '(^|,)1-65535($|,)'; then
ports=$(echo "$ports" | tr -d ' ' | sed 's/:/-/g' | tr ',' '\n' | awk '!a[$0]++' | grep -v '^$')
[ -z "$ports" ] && { echo ""; return; }
if echo "$ports" | grep -q '^1-65535$'; then
echo ""
return
fi
echo "$2 {$ports}"
local port
local port_list=""
for port in $ports; do
port_list="${port_list},$port"
done
port_list="${port_list#,}"
echo "$2 {$port_list}"
fi
}