mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-02 14:40:52 +03:00
Compare commits
4 Commits
7be758d995
...
23879741fb
Author | SHA1 | Date | |
---|---|---|---|
|
23879741fb | ||
|
7c7d66d4ef | ||
|
bbb337e5d5 | ||
|
bc4ed19080 |
@ -1,24 +1,23 @@
|
||||
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.placeholder = "--split-pos=2"
|
||||
function checkDoubleMinus(inputString)
|
||||
function opt.validate(self, value)
|
||||
-- Split the string into words
|
||||
local words = {}
|
||||
for word in inputString:gmatch("%S+") do
|
||||
for word in value:gmatch("%S+") do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
-- Check each word
|
||||
for _, word in ipairs(words) do
|
||||
if not word:sub(1, 2) == "--" then
|
||||
return false, translate("Error: Not all words start with double minuses.")
|
||||
return nil, opt.error = translate("Error: Not all options start with double dash.")
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
return value
|
||||
end
|
||||
opt.validate = checkDoubleMinus(opt.Value)
|
||||
|
||||
b = c:option(Flag, "block_quic", "Block QUIC", translate("Block QUIC protocol to come outside"))
|
||||
lp = c:option(Value, "port", translate("Listen Port"))
|
||||
lp.datatype = "port"
|
||||
|
Loading…
Reference in New Issue
Block a user