Browse Source

Update zapret-tpws.lua

fix some mistypes
pull/429/head
NewUse 11 months ago
committed by GitHub
parent
commit
d73212a195
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      docs/compile/openwrt/package/zapret/luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua

10
docs/compile/openwrt/package/zapret/luci-app-zapret-tpws/luasrc/model/cbi/zapret-tpws.lua

@ -1,23 +1,19 @@
m = Map("zapret", translate("TPWS Proxy Settings"))c = m:section(NamedSection, "tpws", "zapret", translate("Configuration")) m = Map("zapret", translate("TPWS Proxy Settings"))
c = m:section(NamedSection, "tpws", "zapret", translate("Configuration"))
opt = c:option(Value, "opts", translate("TPWS Options")) opt = c:option(Value, "opts", translate("TPWS Options"))
opt.placeholder = "--split-pos=2" opt.placeholder = "--split-pos=2"
function opt.validate(self, value) function opt.validate(self, value)
-- Split the string into words
local words = {} local words = {}
for word in value:gmatch("%S+") do for word in value:gmatch("%S+") do
table.insert(words, word) table.insert(words, word)
end end
-- Check each word
for _, word in ipairs(words) do for _, word in ipairs(words) do
if not word:sub(1, 2) == "--" then if not word:sub(1, 2) == "--" then
return nil, opt.error = translate("Error: Not all options start with double dash.") return nil
end end
end end
return value return value
end end
b = c:option(Flag, "block_quic", "Block QUIC", translate("Block QUIC protocol to come outside")) b = c:option(Flag, "block_quic", "Block QUIC", translate("Block QUIC protocol to come outside"))
lp = c:option(Value, "port", translate("Listen Port")) lp = c:option(Value, "port", translate("Listen Port"))
lp.datatype = "port" lp.datatype = "port"

Loading…
Cancel
Save