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({ use_global_config = true })
o:depends({ _udp_node_bool = "1" }) 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 = s:option(Flag, "use_direct_list", translatef("Use %s", translate("Direct List")))
o.default = "1" o.default = "1"
o:depends({ _tcp_node_bool = "1" }) o:depends({ _tcp_node_bool = "1" })

View File

@ -107,6 +107,13 @@ o:value("1:65535", translate("All"))
o:value("53", "DNS") o:value("53", "DNS")
o.validate = port_validate 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 ---- Use nftables
o = s:option(ListValue, "use_nft", translate("Firewall tools")) o = s:option(ListValue, "use_nft", translate("Firewall tools"))
o.default = "0" 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." msgid "Fill in the ports you don't want to be forwarded by the agent, with the highest priority."
msgstr "填写你不希望被代理转发的端口,优先级最高。" 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" msgid "TCP Proxy Drop Ports"
msgstr "TCP 转发屏蔽端口" 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 elif echo "$1" | grep -qE '([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}'; then
echo "$2 {$1}" echo "$2 {$1}"
else else
ports=$(echo "$ports" | tr -d ' ' | sed 's/:/-/g') ports=$(echo "$ports" | tr -d ' ' | sed 's/:/-/g' | tr ',' '\n' | awk '!a[$0]++' | grep -v '^$')
if echo "$ports" | grep -qE '(^|,)1-65535($|,)'; then [ -z "$ports" ] && { echo ""; return; }
if echo "$ports" | grep -q '^1-65535$'; then
echo "" echo ""
return return
fi 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 fi
} }